infinityonline commited on
Commit
c56debe
·
verified ·
1 Parent(s): 9b00487

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -14
Dockerfile CHANGED
@@ -1,13 +1,10 @@
1
  FROM python:3.10-slim
2
-
3
  RUN useradd -m -u 1000 user
4
  ENV HOME=/home/user \
5
  PATH=/home/user/.local/bin:$PATH \
6
  PYTHONUNBUFFERED=1 \
7
  PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
8
-
9
  WORKDIR /home/user/app
10
-
11
  RUN apt-get update && apt-get install -y \
12
  wget gnupg ca-certificates curl \
13
  libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 \
@@ -15,27 +12,20 @@ RUN apt-get update && apt-get install -y \
15
  libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 \
16
  libpango-1.0-0 libcairo2 libasound2 \
17
  && rm -rf /var/lib/apt/lists/*
18
-
19
  COPY --chown=user requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
-
22
  RUN mkdir -p /etc/apt/keyrings \
23
  && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
24
- | gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg \
25
  && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] \
26
- http://dl.google.com/linux/chrome/deb/ stable main" \
27
- > /etc/apt/sources.list.d/google-chrome.list \
28
  && apt-get update && apt-get install -y google-chrome-stable \
29
  && rm -rf /var/lib/apt/lists/*
30
-
31
  RUN playwright install chromium
32
-
33
  COPY --chown=user . .
34
-
35
  USER user
36
  EXPOSE 7860
37
-
38
  HEALTHCHECK --interval=30s --timeout=15s --start-period=120s --retries=3 \
39
  CMD curl -f http://localhost:7860/health || exit 1
40
-
41
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
 
2
  RUN useradd -m -u 1000 user
3
  ENV HOME=/home/user \
4
  PATH=/home/user/.local/bin:$PATH \
5
  PYTHONUNBUFFERED=1 \
6
  PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
 
7
  WORKDIR /home/user/app
 
8
  RUN apt-get update && apt-get install -y \
9
  wget gnupg ca-certificates curl \
10
  libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 \
 
12
  libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 \
13
  libpango-1.0-0 libcairo2 libasound2 \
14
  && rm -rf /var/lib/apt/lists/*
 
15
  COPY --chown=user requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
 
17
  RUN mkdir -p /etc/apt/keyrings \
18
  && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
19
+ | gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg \
20
  && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] \
21
+ http://dl.google.com/linux/chrome/deb/ stable main" \
22
+ > /etc/apt/sources.list.d/google-chrome.list \
23
  && apt-get update && apt-get install -y google-chrome-stable \
24
  && rm -rf /var/lib/apt/lists/*
 
25
  RUN playwright install chromium
 
26
  COPY --chown=user . .
 
27
  USER user
28
  EXPOSE 7860
 
29
  HEALTHCHECK --interval=30s --timeout=15s --start-period=120s --retries=3 \
30
  CMD curl -f http://localhost:7860/health || exit 1
31
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]