Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official lightweight Python image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy project files
|
| 8 |
+
COPY example.py /app/
|
| 9 |
+
COPY index.html /app/templates/index.html
|
| 10 |
+
|
| 11 |
+
# Copy your dependency file if it exists (optional)
|
| 12 |
+
# If not, we’ll create one on the fly
|
| 13 |
+
RUN echo "Flask==3.0.3\npython-dotenv\nTogether==0.2.8" > requirements.txt
|
| 14 |
+
|
| 15 |
+
# Install Python dependencies
|
| 16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
+
|
| 18 |
+
# Expose port 7860 (required by Hugging Face Spaces)
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
# Set environment variables
|
| 22 |
+
ENV PORT=7860
|
| 23 |
+
ENV PYTHONUNBUFFERED=1
|
| 24 |
+
|
| 25 |
+
# Start the Flask app
|
| 26 |
+
CMD ["python", "example.py"]
|