Spaces:
Sleeping
Sleeping
Test Dockerfile pyvroom
Browse files- Dockerfile +21 -11
Dockerfile
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 4 |
-
git build-essential cmake \
|
| 5 |
-
libssl-dev libasio-dev \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
RUN uv pip install --system /app/pyvroom/
|
| 13 |
|
| 14 |
-
|
| 15 |
COPY . /app
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
|
|
| 1 |
+
# ====== Étape 1 : Base ======
|
| 2 |
FROM python:3.12-slim
|
| 3 |
|
| 4 |
+
# Éviter les prompts interactifs pendant l'installation
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Installer les dépendances système nécessaires
|
| 8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
+
git build-essential cmake libssl-dev libasio-dev \
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# ====== Étape 2 : Copier le wheel précompilé et l'app ======
|
| 13 |
+
WORKDIR /app
|
| 14 |
|
| 15 |
+
# Copier le wheel pyvroom
|
| 16 |
+
COPY pyvroom/dist/pyvroom-*.whl /tmp/
|
|
|
|
| 17 |
|
| 18 |
+
# Copier ton application et requirements
|
| 19 |
COPY . /app
|
| 20 |
|
| 21 |
+
# ====== Étape 3 : Installer les dépendances ======
|
| 22 |
+
# Installer le wheel pyvroom
|
| 23 |
+
RUN pip install /tmp/pyvroom-*.whl
|
| 24 |
|
| 25 |
+
# Installer les dépendances Python de ton projet (Panel, etc.)
|
| 26 |
+
RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt; fi
|
| 27 |
|
| 28 |
+
# ====== Étape 4 : Configuration Panel ======
|
| 29 |
+
ENV PORT=7860
|
| 30 |
+
EXPOSE 7860
|
| 31 |
|
| 32 |
+
# ====== Étape 5 : Commande de lancement ======
|
| 33 |
+
CMD ["panel", "serve", "app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin=*"]
|