@@ -10,10 +10,32 @@ services:
1010 - MONGO_INITDB_ROOT_PASSWORD=noteblockworldpassword
1111 - MONGO_INITDB_DATABASE=noteblockworld
1212 - MONGO_INITDB_ROOT_USERNAME=noteblockworlduser
13+ healthcheck :
14+ test :
15+ [
16+ ' CMD' ,
17+ ' mongosh' ,
18+ ' -u' ,
19+ ' noteblockworlduser' ,
20+ ' -p' ,
21+ ' noteblockworldpassword' ,
22+ ' --authenticationDatabase' ,
23+ ' admin' ,
24+ ' --eval' ,
25+ " db.adminCommand('ping').ok" ,
26+ ]
27+ interval : 5s
28+ timeout : 5s
29+ retries : 10
30+ start_period : 15s
1331
1432 maildev :
1533 container_name : noteblockworld-maildev-dev
1634 image : maildev/maildev
35+ # Image HEALTHCHECK can report unhealthy and block `compose up --wait`, so
36+ # `docker:minio-init` never runs and MinIO buckets are never created.
37+ healthcheck :
38+ disable : true
1739 ports :
1840 - ' 1080:1080' # Web Interface
1941 - ' 1025:1025' # SMTP Server
@@ -35,15 +57,25 @@ services:
3557 - MINIO_ROOT_PASSWORD=minioadmin
3658 volumes :
3759 - minio_data:/data
60+ healthcheck :
61+ test : ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
62+ interval : 5s
63+ timeout : 5s
64+ retries : 10
65+ start_period : 10s
3866 # You can access the MinIO web interface at http://localhost:9000
3967 # You can access the MinIO console at http://localhost:9001
4068
69+ # One-shot: exits 0 after buckets/CORS. Not part of `up --wait` (that waits for long-running services).
4170 mc :
4271 container_name : minio-client
72+ profiles :
73+ - minio-init
4374 image : minio/mc
4475 entrypoint : ['/bin/sh', '-c']
4576 depends_on :
46- - minio
77+ minio :
78+ condition : service_healthy
4779 environment :
4880 - MINIO_ROOT_USER=minioadmin
4981 - MINIO_ROOT_PASSWORD=minioadmin
0 commit comments