build image
This commit is contained in:
@@ -5,21 +5,30 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copia pyproject.toml, codice sorgente e file di configurazione
|
||||
# Copia pyproject.toml, codice sorgente e file statici
|
||||
# NOTA: env/ NON viene copiato - sarà montato come volume esterno
|
||||
COPY pyproject.toml ./
|
||||
COPY src/ ./src/
|
||||
COPY env/ ./env/
|
||||
COPY certs/ ./certs/
|
||||
COPY matlab_func/ ./matlab_func/
|
||||
|
||||
# Installa le dipendenze
|
||||
RUN uv pip install --system -e .
|
||||
|
||||
# Crea directory per i log, FTP e MATLAB
|
||||
RUN mkdir -p /app/logs /app/aseftp/csvfs /app/certs /app/matlab_runtime /app/matlab_func
|
||||
# Compila tutti i file Python in bytecode
|
||||
# Usa -OO per rimuovere docstring e assert (ottimizzazione massima)
|
||||
RUN python -OO -m compileall /app/src || true
|
||||
|
||||
# Rimuovi tutti i file sorgente .py, lasciando solo i .pyc compilati in __pycache__
|
||||
RUN find /app/src -type f -name "*.py" -delete
|
||||
|
||||
# Crea directory per i log, FTP, MATLAB e ENV (sarà montata)
|
||||
RUN mkdir -p /app/logs /app/aseftp/csvfs /app/certs /app/matlab_runtime /app/matlab_func /app/env
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONPATH=/app
|
||||
# Disabilita la creazione di nuovi file .pyc a runtime (non necessari dato che abbiamo già i .pyc)
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Il comando verrà specificato nel docker-compose.yml per ogni servizio
|
||||
CMD ["python", "-m", "src.elab_orchestrator"]
|
||||
|
||||
Reference in New Issue
Block a user