dragg2 commited on
Commit
d2d6db4
·
verified ·
1 Parent(s): 60330eb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -2
Dockerfile CHANGED
@@ -1,12 +1,22 @@
1
  FROM python:3.11-slim-bookworm
2
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
7
- RUN playwright install --with-deps chromium
 
 
8
 
9
- COPY . .
10
 
11
  EXPOSE 7860
12
 
 
1
  FROM python:3.11-slim-bookworm
2
 
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
5
+ SERVER_HOST=0.0.0.0 \
6
+ SERVER_PORT=7860
7
+
8
+ RUN useradd -m -u 1000 user
9
+ RUN mkdir -p /ms-playwright /app && chown -R user:user /ms-playwright /app
10
+
11
  WORKDIR /app
12
 
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
15
+ RUN playwright install --with-deps chromium && chmod -R 755 /ms-playwright
16
+
17
+ COPY --chown=user:user . .
18
 
19
+ USER user
20
 
21
  EXPOSE 7860
22