Modify docker-compose.yaml
- Add mongo service - Add depend mongo config for chat-api
This commit is contained in:
@@ -1,4 +1,26 @@
|
||||
services:
|
||||
mongo:
|
||||
image: mongo:8.2.7
|
||||
container_name: chat-mongo-test
|
||||
ports:
|
||||
- "27017:27017"
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: chat-redis-test
|
||||
ports:
|
||||
- "6379:6379"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 3s
|
||||
timeout: 2s
|
||||
retries: 5
|
||||
|
||||
chat-api:
|
||||
build:
|
||||
context: ../../../../
|
||||
@@ -6,11 +28,12 @@ services:
|
||||
container_name: chat-api-test
|
||||
ports:
|
||||
- "28888:8888"
|
||||
- "28889:8889"
|
||||
- "28443:8443/udp"
|
||||
volumes:
|
||||
- ./certs:/etc/certs:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "true"]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 5
|
||||
depends_on:
|
||||
mongo:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
Reference in New Issue
Block a user