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-slim
|
| 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 3100
|
| 22 |
+
|
| 23 |
+
# Define the command to run the application
|
| 24 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:3100", "run:app"]
|