Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +10 -18
Dockerfile
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
# 1.
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# 2.
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
WORKDIR /App
|
| 7 |
|
| 8 |
-
# 3.
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
git \
|
| 11 |
ffmpeg \
|
|
@@ -14,21 +14,13 @@ RUN apt-get update && apt-get install -y \
|
|
| 14 |
libgl1 \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# 4.
|
| 18 |
-
# Definiamo la variabile che conterrà il token segreto
|
| 19 |
-
ARG GITHUB_TOKEN
|
| 20 |
-
|
| 21 |
-
# Clona il tuo repository PRIVATO nella cartella corrente
|
| 22 |
-
# Sostituisce il vecchio "COPY . ."
|
| 23 |
-
RUN git clone https://${GITHUB_TOKEN}@github.com/Elyon7/Cosmo-Edu_Lab.git .
|
| 24 |
-
|
| 25 |
-
# 5. Installa le librerie Python (leggendo il file appena scaricato)
|
| 26 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
-
|
| 28 |
-
# 6. Configurazione ambiente
|
| 29 |
EXPOSE 7860
|
| 30 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
# Usiamo
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1. Base Image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# 2. Setup ambiente base
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
WORKDIR /App
|
| 7 |
|
| 8 |
+
# 3. Installiamo Git e le librerie di sistema (questo si può fare nel build)
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
git \
|
| 11 |
ffmpeg \
|
|
|
|
| 14 |
libgl1 \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# 4. Configurazione Porta e Matplotlib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
EXPOSE 7860
|
| 19 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 20 |
|
| 21 |
+
# 5. IL TRUCCO: Tutto avviene qui, nel CMD (Shell Form)
|
| 22 |
+
# Usiamo "sh -c" implicito per permettere l'uso della variabile $GITHUB_TOKEN
|
| 23 |
+
# Nota: Sostituisci 'App/main.py' con il percorso vero del tuo file se diverso.
|
| 24 |
+
CMD git clone https://$GITHUB_TOKEN@github.com/Elyon7/Cosmo-Edu_Lab.git . && \
|
| 25 |
+
pip install --no-cache-dir -r requirements.txt && \
|
| 26 |
+
python App/main.py
|