Spaces:
Sleeping
Sleeping
Commit ·
b60ea41
1
Parent(s): e4d26c5
Track sqlite databases with git-lfs
Browse files- Dockerfile +15 -12
Dockerfile
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# Install nginx
|
| 4 |
RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
|
|
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
COPY requirements.txt .
|
| 10 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
COPY
|
| 14 |
-
COPY nginx.conf /etc/nginx/nginx.conf
|
| 15 |
-
COPY start.sh /start.sh
|
| 16 |
-
RUN chmod +x /start.sh
|
| 17 |
|
| 18 |
-
#
|
|
|
|
|
|
|
|
|
|
| 19 |
ENV PORT=7860
|
| 20 |
|
| 21 |
-
# Expose
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
| 1 |
+
# Base image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# 1. Install system dependencies (nginx)
|
| 5 |
RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
+
# 2. Set working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# 3. Copy requirements and install dependencies
|
| 11 |
+
COPY requirements.txt /app/requirements.txt
|
| 12 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 13 |
|
| 14 |
+
# 4. Copy your entire app into /app (not just app.py)
|
| 15 |
+
COPY . /app
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
# 5. Make sure start.sh exists and is executable
|
| 18 |
+
RUN chmod +x /app/start.sh
|
| 19 |
+
|
| 20 |
+
# 6. Hugging Face sets PORT automatically
|
| 21 |
ENV PORT=7860
|
| 22 |
|
| 23 |
+
# 7. Expose the port (useful for local testing)
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# 8. Start your app (start.sh must keep one process in foreground)
|
| 27 |
+
CMD ["/app/start.sh"]
|