HeoooLel commited on
Commit
7f46342
·
verified ·
1 Parent(s): 1218470

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -9
Dockerfile CHANGED
@@ -1,22 +1,22 @@
1
  FROM python:3.9-slim
2
 
3
- # Install basic system tools
4
- RUN apt-get update && apt-get install -y \
5
- wget \
6
- gnupg \
7
- && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
- # Install Python requirements
12
- RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth
13
 
14
- # This command installs all necessary browser dependencies automatically
 
15
  RUN playwright install --with-deps chromium
16
 
17
  COPY . .
18
 
19
- # Hugging Face port
 
 
20
  EXPOSE 7860
21
 
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Set environment variables so Playwright works in a limited environment
4
+ ENV PLAYWRIGHT_BROWSERS_PATH=/app/pw-browsers
5
+ ENV HOME=/app
 
 
6
 
7
  WORKDIR /app
8
 
9
+ RUN apt-get update && apt-get install -y wget gnupg && rm -rf /var/lib/apt/lists/*
 
10
 
11
+ RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth
12
+ # Install browser in the local app folder
13
  RUN playwright install --with-deps chromium
14
 
15
  COPY . .
16
 
17
+ # Give full permissions to the app folder
18
+ RUN chmod -R 777 /app
19
+
20
  EXPOSE 7860
21
 
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]