Spaces:
Runtime error
Runtime error
xyplon
commited on
Update Dockerfile
Browse files- Dockerfile +7 -6
Dockerfile
CHANGED
@@ -1,22 +1,23 @@
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
# Copy the current directory contents into the container at /app
|
7 |
-
COPY .
|
8 |
|
9 |
# Install Gunicorn and your application dependencies
|
10 |
RUN pip install --no-cache-dir gunicorn && \
|
11 |
pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
# Expose the port Gunicorn will listen on
|
14 |
EXPOSE 7860
|
15 |
|
16 |
-
#
|
17 |
ENV FLASK_APP=app.py
|
18 |
ENV FLASK_RUN_HOST=0.0.0.0
|
19 |
ENV FLASK_RUN_PORT=7860
|
20 |
|
21 |
-
# Run the Gunicorn server
|
22 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
1 |
+
# Use the Python 3.9 slim image as the base
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . .
|
9 |
|
10 |
# Install Gunicorn and your application dependencies
|
11 |
RUN pip install --no-cache-dir gunicorn && \
|
12 |
pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
+
# Expose the port that Gunicorn will listen on
|
15 |
EXPOSE 7860
|
16 |
|
17 |
+
# Set environment variables for Flask application
|
18 |
ENV FLASK_APP=app.py
|
19 |
ENV FLASK_RUN_HOST=0.0.0.0
|
20 |
ENV FLASK_RUN_PORT=7860
|
21 |
|
22 |
+
# Run the Gunicorn server with the appropriate worker class (gthread)
|
23 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--worker-class", "gthread", "app:app"]
|