xyplon
commited on
Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
|
@@ -1,16 +1,22 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY . /app
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 9 |
|
|
|
|
| 10 |
EXPOSE 7860
|
| 11 |
|
|
|
|
| 12 |
ENV FLASK_APP=app.py
|
| 13 |
ENV FLASK_RUN_HOST=0.0.0.0
|
| 14 |
ENV FLASK_RUN_PORT=7860
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
| 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 . /app
|
| 8 |
|
| 9 |
+
# Install dependencies
|
| 10 |
+
COPY requirements.txt /app/requirements.txt
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Expose the port Gunicorn will listen on
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
+
# Define environment variables
|
| 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"]
|