Spaces:
Sleeping
Sleeping
Added Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python 3.12 runtime as a parent image
|
| 2 |
+
FROM python:3.12
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy the requirements.txt file into the container
|
| 8 |
+
COPY requirements.txt /app/requirements.txt
|
| 9 |
+
|
| 10 |
+
# Install the required packages
|
| 11 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 12 |
+
|
| 13 |
+
# Copy the rest of the application code into the container
|
| 14 |
+
COPY . /app
|
| 15 |
+
|
| 16 |
+
# Set environment variables
|
| 17 |
+
ENV FLASK_APP=run.py
|
| 18 |
+
ENV FLASK_ENV=production
|
| 19 |
+
|
| 20 |
+
# Expose the port the app runs on
|
| 21 |
+
EXPOSE 7860
|
| 22 |
+
|
| 23 |
+
# Define the command to run the application
|
| 24 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "run:app"]
|