heboya8 commited on
Commit
6173ca6
·
verified ·
1 Parent(s): e570e25

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- # Use the official Python 3.9 image
2
  FROM python:3.9-slim
3
 
4
- # Create a non-root user
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
@@ -9,12 +9,12 @@ ENV PATH="/home/user/.local/bin:$PATH"
9
  # Set working directory
10
  WORKDIR /app
11
 
12
- # Copy and install dependencies
13
  COPY --chown=user ./requirements.txt requirements.txt
14
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
 
16
- # Copy the rest of the application
17
  COPY --chown=user . /app
18
 
19
- # Run the app with gunicorn
20
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
1
+ # Use lightweight Python image
2
  FROM python:3.9-slim
3
 
4
+ # Create non-root user
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
 
9
  # Set working directory
10
  WORKDIR /app
11
 
12
+ # Install dependencies
13
  COPY --chown=user ./requirements.txt requirements.txt
14
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
 
16
+ # Copy application files
17
  COPY --chown=user . /app
18
 
19
+ # Run with gunicorn
20
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]