Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.9 slim image as base
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy requirements first for better caching
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
+
|
| 13 |
+
# Copy application files
|
| 14 |
+
COPY app.py .
|
| 15 |
+
COPY wordle_words.txt .
|
| 16 |
+
COPY templates/ templates/
|
| 17 |
+
COPY static/ static/
|
| 18 |
+
|
| 19 |
+
# Create a non-root user for security
|
| 20 |
+
RUN useradd --create-home --shell /bin/bash app && chown -R app:app /app
|
| 21 |
+
USER app
|
| 22 |
+
|
| 23 |
+
# Expose port 7860 (Hugging Face Spaces default)
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
|
| 26 |
+
# Set environment variables
|
| 27 |
+
ENV FLASK_APP=app.py
|
| 28 |
+
ENV FLASK_ENV=production
|
| 29 |
+
|
| 30 |
+
# Run the application
|
| 31 |
+
CMD ["python", "app.py"]
|