Update Dockerfile
Browse files- Dockerfile +21 -4
Dockerfile
CHANGED
|
@@ -1,12 +1,29 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
RUN
|
|
|
|
|
|
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY . .
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
EXPOSE 7860
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
| 1 |
+
# Use a slim Python image for efficiency
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies if needed (none strictly required for aiohttp, but good practice)
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
build-essential \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Copy requirements and install
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
+
|
| 16 |
+
# Copy the rest of the application
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
+
# Hugging Face Spaces run on port 7860 by default
|
| 20 |
+
ENV SERVER_PORT=7860
|
| 21 |
+
# You should set these in the Hugging Face Space Settings (Secrets),
|
| 22 |
+
# but we set defaults here to prevent the app from crashing.
|
| 23 |
+
ENV ADMIN_PATH=/admin-panel
|
| 24 |
+
|
| 25 |
+
# Expose the port
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
+
# Run the application
|
| 29 |
+
CMD ["python", "main.py"]
|