simar007 commited on
Commit
2d9ac02
·
verified ·
1 Parent(s): abba5c7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -9
Dockerfile CHANGED
@@ -1,18 +1,22 @@
1
- # Use official Python image
2
  FROM python:3.11-slim
3
 
4
- # Set working directory
 
 
 
 
5
  WORKDIR /app
6
 
7
- # Copy requirements and install
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy app files
12
- COPY app ./app
13
 
14
- # Expose port
15
- EXPOSE 8000
16
 
17
- # Run with Gunicorn
18
- CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app.app:app"]
 
1
+ # Use the official Python base image
2
  FROM python:3.11-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set working directory inside container
9
  WORKDIR /app
10
 
11
+ # Copy requirements and install dependencies
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy the rest of the app
16
+ COPY . .
17
 
18
+ # Expose the port Flask runs on
19
+ EXPOSE 8080
20
 
21
+ # Run the app with Gunicorn
22
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]