docker image su registry e create con pyinstaller
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user