Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -11
Dockerfile
CHANGED
@@ -1,21 +1,27 @@
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
-
FROM python:3.
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
|
|
|
|
|
9 |
|
10 |
-
# Install
|
|
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
ENV QUART_RUN_HOST=0.0.0.0
|
19 |
|
20 |
-
#
|
21 |
-
CMD ["
|
|
|
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"]
|