Spaces:
Runtime error
Runtime error
tech-envision
commited on
Commit
·
372692b
1
Parent(s):
8c1df92
Add Dockerfile and dockerignore for HF Space
Browse files- .dockerignore +6 -0
- Dockerfile +26 -0
.dockerignore
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*.db
|
| 5 |
+
uploads/
|
| 6 |
+
vm_state/
|
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use official Python runtime as a parent image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Ensure stdout/stderr logs are shown in real time
|
| 5 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 6 |
+
PIP_NO_CACHE_DIR=1
|
| 7 |
+
|
| 8 |
+
# Install any system dependencies if required
|
| 9 |
+
RUN apt-get update && apt-get install -y --no-install-recommends git \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Set working directory
|
| 13 |
+
WORKDIR /app
|
| 14 |
+
|
| 15 |
+
# Install Python dependencies first for better cache utilisation
|
| 16 |
+
COPY requirements.txt ./
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
# Copy the rest of the application code
|
| 20 |
+
COPY . .
|
| 21 |
+
|
| 22 |
+
# Expose Gradio default port (HuggingFace sets $PORT automatically)
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Start the Gradio application
|
| 26 |
+
CMD ["python", "app.py"]
|