Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +19 -7
Dockerfile
CHANGED
|
@@ -1,17 +1,29 @@
|
|
| 1 |
# === Base Image ===
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# === Install dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 9 |
-
rm -rf /root/.cache/pip
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
# ===
|
| 13 |
-
|
| 14 |
|
| 15 |
-
# ===
|
| 16 |
EXPOSE 7860
|
| 17 |
-
|
|
|
|
|
|
|
|
|
| 1 |
# === Base Image ===
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# === Set working directory ===
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# === Install system dependencies ===
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
+
build-essential \
|
| 10 |
+
git \
|
| 11 |
+
curl \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# === Copy dependency list and install ===
|
| 15 |
COPY requirements.txt .
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 17 |
+
rm -rf /root/.cache/pip
|
| 18 |
+
|
| 19 |
+
# === Copy application files ===
|
| 20 |
+
COPY . .
|
| 21 |
|
| 22 |
+
# === Make entrypoint executable ===
|
| 23 |
+
RUN chmod +x entrypoint.sh
|
| 24 |
|
| 25 |
+
# === Expose app port ===
|
| 26 |
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# === Use custom entrypoint ===
|
| 29 |
+
ENTRYPOINT ["./entrypoint.sh"]
|