Modify docker-compose.yaml
- Add mongo service - Add depend mongo config for chat-api
This commit is contained in:
@@ -1,4 +1,26 @@
|
|||||||
services:
|
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:
|
chat-api:
|
||||||
build:
|
build:
|
||||||
context: ../../../../
|
context: ../../../../
|
||||||
@@ -6,11 +28,12 @@ services:
|
|||||||
container_name: chat-api-test
|
container_name: chat-api-test
|
||||||
ports:
|
ports:
|
||||||
- "28888:8888"
|
- "28888:8888"
|
||||||
|
- "28889:8889"
|
||||||
- "28443:8443/udp"
|
- "28443:8443/udp"
|
||||||
volumes:
|
volumes:
|
||||||
- ./certs:/etc/certs:ro
|
- ./certs:/etc/certs:ro
|
||||||
healthcheck:
|
depends_on:
|
||||||
test: ["CMD", "true"]
|
mongo:
|
||||||
interval: 2s
|
condition: service_healthy
|
||||||
timeout: 2s
|
redis:
|
||||||
retries: 5
|
condition: service_healthy
|
||||||
|
|||||||
@@ -42,6 +42,20 @@ services:
|
|||||||
- "6380:6379"
|
- "6380:6379"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: mongo:8.2.7
|
||||||
|
container_name: juwan-mongo
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
volumes:
|
||||||
|
- mongodata:/data/db
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
kafka:
|
kafka:
|
||||||
image: apache/kafka:4.0.1
|
image: apache/kafka:4.0.1
|
||||||
container_name: juwan-kafka
|
container_name: juwan-kafka
|
||||||
@@ -444,12 +458,15 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "18810:8888"
|
- "18810:8888"
|
||||||
|
- "18889:8889"
|
||||||
- "18443:8443/udp"
|
- "18443:8443/udp"
|
||||||
volumes:
|
volumes:
|
||||||
- ./certs:/etc/certs:ro
|
- ./certs:/etc/certs:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
chat-rpc:
|
mongo:
|
||||||
condition: service_started
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
review-api:
|
review-api:
|
||||||
image: juwan/review-api:dev
|
image: juwan/review-api:dev
|
||||||
@@ -518,3 +535,5 @@ volumes:
|
|||||||
name: juwan-pgdata
|
name: juwan-pgdata
|
||||||
redisdata:
|
redisdata:
|
||||||
name: juwan-redisdata
|
name: juwan-redisdata
|
||||||
|
mongodata:
|
||||||
|
name: juwan-mongodata
|
||||||
|
|||||||
Reference in New Issue
Block a user