@@ -28,6 +28,22 @@ services:
2828 timeout : 5s
2929 retries : 3
3030
31+ migrations :
32+ image : mtsrus/syncmaster-backend:${BACKEND_IMAGE_TAG:-test}
33+ restart : unless-stopped
34+ build :
35+ dockerfile : docker/Dockerfile.backend
36+ context : .
37+ target : test
38+ volumes :
39+ - ./syncmaster:/app/syncmaster
40+ entrypoint : [python, -m, syncmaster.db.migrations, upgrade, head]
41+ env_file : .env.docker
42+ depends_on :
43+ db :
44+ condition : service_healthy
45+ profiles : [backend, worker, scheduler, all]
46+
3147 backend :
3248 image : mtsrus/syncmaster-backend:${BACKEND_IMAGE_TAG:-test}
3349 restart : unless-stopped
@@ -41,15 +57,22 @@ services:
4157 volumes :
4258 - ./syncmaster:/app/syncmaster
4359 - ./docs/_static:/app/docs/_static
44- - ./cached_jars:/root/.ivy2
4560 - ./reports:/app/reports
4661 - ./tests:/app/tests
4762 - ./pyproject.toml:/app/pyproject.toml
4863 depends_on :
4964 db :
5065 condition : service_healthy
66+ migrations :
67+ condition : service_completed_successfully
5168 rabbitmq :
5269 condition : service_healthy
70+ healthcheck :
71+ test : [CMD-SHELL, curl -f http://localhost:8000/monitoring/ping]
72+ interval : 30s
73+ timeout : 5s
74+ retries : 3
75+ start_period : 5s
5376 profiles : [backend, all]
5477
5578 scheduler :
@@ -68,6 +91,8 @@ services:
6891 depends_on :
6992 db :
7093 condition : service_healthy
94+ migrations :
95+ condition : service_completed_successfully
7196 rabbitmq :
7297 condition : service_healthy
7398 profiles : [scheduler, all]
@@ -94,6 +119,8 @@ services:
94119 depends_on :
95120 db :
96121 condition : service_healthy
122+ migrations :
123+ condition : service_completed_successfully
97124 rabbitmq :
98125 condition : service_healthy
99126 profiles : [worker, scheduler, s3, oracle, hdfs, hive, clickhouse, mysql, mssql, all]
0 commit comments