etukurudinesh commited on
Commit
8a81b9f
·
1 Parent(s): 191e833

fix: Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -25
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  libnss3 \
5
  libnspr4 \
@@ -17,35 +18,19 @@ RUN apt-get update && apt-get install -y \
17
  mc \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
- WORKDIR /code
21
-
22
- COPY ./requirements.txt /code/requirements.txt
23
-
24
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
25
-
26
- RUN pip install playwright
27
- RUN playwright install --with-deps
28
-
29
-
30
  RUN useradd -m -u 1000 user
31
  USER user
 
32
 
33
- ENV HOME=/home/user \
34
- PATH=/home/user/.local/bin:$PATH \
35
- PYTHONPATH=$HOME/app \
36
- PYTHONUNBUFFERED=1 \
37
- GRADIO_ALLOW_FLAGGING=never \
38
- GRADIO_NUM_PORTS=1 \
39
- GRADIO_SERVER_NAME=0.0.0.0 \
40
- GRADIO_THEME=huggingface \
41
- SYSTEM=spaces
42
 
43
- # Set the working directory to the user's home directory
44
- WORKDIR $HOME/app
45
 
 
 
46
  RUN playwright install firefox
47
 
48
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
49
- COPY --chown=user . $HOME/app
50
-
51
- CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies for Playwright
4
  RUN apt-get update && apt-get install -y \
5
  libnss3 \
6
  libnspr4 \
 
18
  mc \
19
  && rm -rf /var/lib/apt/lists/*
20
 
 
 
 
 
 
 
 
 
 
 
21
  RUN useradd -m -u 1000 user
22
  USER user
23
+ ENV PATH="/home/user/.local/bin:$PATH"
24
 
25
+ WORKDIR /app
 
 
 
 
 
 
 
 
26
 
27
+ COPY --chown=user ./requirements.txt requirements.txt
28
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
29
 
30
+ # Install Playwright browsers
31
+ RUN playwright install
32
  RUN playwright install firefox
33
 
34
+ COPY --chown=user . /app
35
+ #CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
36
+ CMD ["python", "server.py"]