Elyon7 commited on
Commit
ef976e9
·
verified ·
1 Parent(s): 8bfabd5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -18
Dockerfile CHANGED
@@ -1,11 +1,11 @@
1
- # 1. Usa Python 3.10 (versione che usavi con successo)
2
  FROM python:3.10-slim
3
 
4
- # 2. Impostazioni base
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  WORKDIR /App
7
 
8
- # 3. Installa le librerie di sistema (Git + quelle per la grafica/video)
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. --- FASE DI COLLEGAMENTO A GITHUB ---
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
- # 7. AVVIO DELL'APP
33
- # Usiamo il percorso che avevi nel Dockerfile di GitHub, che sembra quello corretto
34
- CMD ["python", "App/main.py"]
 
 
 
 
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