docker image su registry e create con pyinstaller

This commit is contained in:
2025-11-30 21:19:06 +01:00
parent 3943172db8
commit fd192c7f6b
12 changed files with 701 additions and 87 deletions

View File

@@ -18,12 +18,14 @@ COPY matlab_func/ ./matlab_func/
RUN uv pip install --python=/usr/local/bin/python3 --target=/app/deps .
# Compila tutti i file Python in bytecode
RUN python -OO -m compileall /app/src || true
# Usa -m compileall per generare .pyc standard (non .opt-2.pyc)
RUN python -m compileall /app/src
# Rimuovi tutti i file sorgente .py, lasciando solo i .pyc compilati
RUN find /app/src -type f -name "*.py" -delete
# Manteniamo i file .py per compatibilità (Python userà comunque i .pyc precompilati)
# Nota: Il codice sorgente è visibile ma Python esegue sempre il bytecode .pyc
# Per protezione completa del codice, considera l'uso di PyArmor o simili
# Rimuovi anche i .py dalle dipendenze
# Rimuovi i .py dalle dipendenze per ridurre la dimensione
RUN find /app/deps -type f -name "*.py" -delete || true
# Crea directory vuote per runtime (saranno montate come volumi)