roshcheeku commited on
Commit
50f7d9a
·
verified ·
1 Parent(s): 3c5d6d5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -6,18 +6,19 @@ RUN useradd -m -u 1000 user
6
  # Set working directory
7
  WORKDIR /app
8
  RUN mkdir -p /app/static/plots && chown -R user:user /app/static
9
- # Copy dependencies
10
- COPY --chown=user requirements.txt requirements.txt
 
11
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
 
13
- # Copy the entire project
14
  COPY --chown=user . .
15
 
16
- # Set the user
17
  USER user
18
 
19
- # Expose the port used by Flask
20
  EXPOSE 7860
21
 
22
- # Run the Flask app
23
- CMD ["python", "app.py"]
 
6
  # Set working directory
7
  WORKDIR /app
8
  RUN mkdir -p /app/static/plots && chown -R user:user /app/static
9
+
10
+ # Copy dependencies and install
11
+ COPY --chown=user requirements.txt .
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
+ # Copy the full app
15
  COPY --chown=user . .
16
 
17
+ # Switch to non-root user
18
  USER user
19
 
20
+ # Expose port Hugging Face expects
21
  EXPOSE 7860
22
 
23
+ # Run Flask app using Gunicorn on port 7860
24
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]