forked from DstMlOpsCrypto/MainCrypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-group3.yml
87 lines (87 loc) · 2.51 KB
/
docker-compose-group3.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3'
services:
db:
image: postgres:13
container_name: db
environment:
POSTGRES_USER: crypto
POSTGRES_PASSWORD: crypto
POSTGRES_DB: cryptoDb
restart: always
ports:
- "5440:5432"
volumes:
- crypto_data_volume:/var/lib/postgresql/data
- ./db/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql
healthcheck:
test: [ "CMD", "pg_isready", "-U", "crypto" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
networks:
- app_network
mlflow_db:
build:
context: .
dockerfile: ./mlflow/Dockerfile
container_name: mlflow_db
restart: always
ports:
- "5432:5432"
environment:
- POSTGRES_USER=mlflow
- POSTGRES_PASSWORD=mlflow
- POSTGRES_DB=mlflow
healthcheck:
test: [ "CMD", "pg_isready", "-U", "mlflow" ]
interval: 10s # Vérifie toutes les 10 secondes
timeout: 5s # Attente maximale pour chaque vérification
retries: 5 # Nombre de vérifications avant de déclarer le conteneur "unhealthy"
start_period: 30s # Temps d'attente initial avant de commencer les vérifications
volumes:
- mlflow:/var/lib/postgresql/data
networks:
- app_network
mlflow-server:
#image: ghcr.io/mlflow/mlflow # image officielle MLflow
build:
context: .
dockerfile: ./mlflow/Dockerfile.server
restart: always
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:5000/" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 50s
ports:
- "5000:5000"
volumes:
- ./mlflow:/app
depends_on:
mlflow_db:
condition: service_healthy # Assure que mlflow_db est healthy avant de démarrer
working_dir: /app # Définit le répertoire de travail sur /app où le script de démarrage est localisé
environment:
- MLFLOW_TRACKING_URI=postgresql://mlflow:mlflow@mlflow_db:5432/mlflow
command: [ "mlflow", "server", "--host", "0.0.0.0", "--port", "5000" ] # Exécute MLflow directement
networks:
- app_network
tests-ml:
image: tests-scripts-ml # création image tests-scripts-ml car beaucoup de dépendances à charger
volumes:
- ./scripts:/app/scripts
- ./src:/app/src
- ./tests/unit:/app/tests/units
command: [ "pytest", "/app/tests/units" ] # Exécute les tests dans le conteneur
networks:
- app_network
volumes:
crypto_data_volume:
mlflow:
scripts:
src:
networks:
app_network:
driver: bridge