Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Install any system dependencies (for example, gcc may be needed for some Python packages)
|
| 5 |
+
RUN apt-get update && apt-get install -y gcc
|
| 6 |
+
|
| 7 |
+
# Set the working directory to /app
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
|
| 10 |
+
# Copy the requirements file into the container at /app
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
|
| 13 |
+
# Upgrade pip and install any needed packages specified in requirements.txt
|
| 14 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 15 |
+
|
| 16 |
+
# Copy the rest of the application code into the container
|
| 17 |
+
COPY . .
|
| 18 |
+
|
| 19 |
+
# Expose port 7860 (or any other port your Flask app uses)
|
| 20 |
+
EXPOSE 7860
|
| 21 |
+
|
| 22 |
+
# Define environment variable for Flask (optional)
|
| 23 |
+
ENV FLASK_APP=app.py
|
| 24 |
+
|
| 25 |
+
# Run the application
|
| 26 |
+
CMD ["python", "app.py"]
|