usman-khn commited on
Commit
487752a
·
verified ·
1 Parent(s): a75a2af

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -1,21 +1,20 @@
1
  FROM python:3.9
2
 
 
3
  WORKDIR /code
4
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
7
 
8
- # Create user
9
  RUN useradd -m -u 1000 user
10
  USER user
11
  ENV HOME=/home/user \
12
  PATH=/home/user/.local/bin:$PATH
13
 
 
14
  COPY --chown=user . /code
15
 
16
- # --- PERMISSION FIX ---
17
- USER root
18
- RUN chmod -R 777 /code
19
- USER user
20
-
21
  CMD ["python", "app.py"]
 
1
  FROM python:3.9
2
 
3
+ # Set the working directory
4
  WORKDIR /code
5
 
6
+ # Copy dependencies and install them
7
  COPY ./requirements.txt /code/requirements.txt
8
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
+ # Create a non-root user (Required for Hugging Face Spaces)
11
  RUN useradd -m -u 1000 user
12
  USER user
13
  ENV HOME=/home/user \
14
  PATH=/home/user/.local/bin:$PATH
15
 
16
+ # Copy the application code
17
  COPY --chown=user . /code
18
 
19
+ # Run the application on port 7860
 
 
 
 
20
  CMD ["python", "app.py"]