Bhushan26 commited on
Commit
a84af31
1 Parent(s): 1aac2c6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -11
Dockerfile CHANGED
@@ -1,21 +1,27 @@
1
  # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
 
 
 
 
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Copy the current directory contents into the container at /app
8
- COPY . /app
 
 
9
 
10
- # Install any needed packages specified in requirements.txt
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Make port 5000 available to the world outside this container
14
- EXPOSE 5000
15
 
16
- # Define environment variable
17
- ENV QUART_APP=main:app
18
- ENV QUART_RUN_HOST=0.0.0.0
19
 
20
- # Run app.py when the container launches
21
- CMD ["hypercorn", "main:app", "--bind", "0.0.0.0:5000"]
 
1
  # Use an official Python runtime as a parent image
2
+ FROM python:3.8-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE 1
6
+ ENV PYTHONUNBUFFERED 1
7
 
8
  # Set the working directory in the container
9
  WORKDIR /app
10
 
11
+ # Install system dependencies
12
+ RUN apt-get update \
13
+ && apt-get install -y --no-install-recommends gcc libpq-dev \
14
+ && rm -rf /var/lib/apt/lists/*
15
 
16
+ # Install Python dependencies
17
+ COPY requirements.txt /app/
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy the application code into the container
21
+ COPY . /app/
22
 
23
+ # Expose the Flask port
24
+ EXPOSE 5000
 
25
 
26
+ # Command to run the application
27
+ CMD ["gunicorn", "--workers=4", "--threads=4", "--bind", "0.0.0.0:5000", "app:app"]