File size: 957 Bytes
c5deede
aa1fced
2a9f585
c5deede
8bfabd5
2a9f585
6a64f4e
2a9f585
 
 
 
 
 
 
c5deede
 
2a9f585
 
c5deede
 
6a64f4e
 
 
e4fb2d4
 
 
 
798713c
e4fb2d4
c5deede
 
 
 
e4fb2d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

FROM python:3.10-slim

ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /App

# 1. Installazione pacchetti di sistema
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    ffmpeg \
    libsm6 \
    libxext6 \
    libgl1 \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

EXPOSE 7860
ENV MPLCONFIGDIR=/tmp/matplotlib

# 2. Avvio dell'applicazione con autenticazione LFS sicura
CMD git config --global credential.helper '!f() { echo "username=oauth2"; echo "password=$GITHUB_TOKEN"; }; f' && \
    if [ -d ".git" ]; then \
        echo "Aggiorno il codice esistente..." && \
        git pull origin main; \
    else \
        echo "Clono il repository..." && \
        git clone https://github.com/cosmo-edu-lab/cosmo-edu-lab.git .; \
    fi && \
    git lfs pull && \
    mkdir -p App/student_submissions && \
    chmod 777 App/student_submissions && \
    pip install --no-cache-dir -r requirements.txt && \
    python -u App/main.py