-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (18 loc) · 723 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (18 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Usa un'immagine Python leggera e sicura
FROM python:3.12-slim
# Variabili d'ambiente per Python
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on
# Imposta la directory di lavoro nel container
WORKDIR /app
# 1. Installiamo prima i requisiti (Sfrutta la cache di Docker!)
# Se cambi il codice ma non i requirements, Docker salta questo step lento.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 2. Copiamo tutto il resto del codice
COPY . .
# Comando di default: Mantiene il container acceso ma inattivo.
# Useremo "docker compose run" per lanciare i comandi specifici (daily/weekly).
CMD ["tail", "-f", "/dev/null"]