-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
84 lines (80 loc) · 2.15 KB
/
docker-compose.dev.yml
File metadata and controls
84 lines (80 loc) · 2.15 KB
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
services:
# ----------------------------
# DATABASE (MongoDB)
# ----------------------------
mongo:
image: mongo:latest
container_name: ecom-mongo
ports:
- "${MONGO_PORT}:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGO_INITDB_DATABASE: ecom_db
volumes:
- mongo-data:/data/db
healthcheck:
test: ["CMD-SHELL", "mongosh --quiet -u ${MONGO_USERNAME} -p ${MONGO_PASSWORD} --authenticationDatabase admin --eval \"db.runCommand({ ping: 1 }).ok\" | grep 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- ecom-network
# ----------------------------
# OBJECT STORAGE (MinIO)
# ----------------------------
minio:
image: minio/minio:latest
container_name: ecom-minio
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
volumes:
- minio-data:/data
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9000/minio/health/live || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- ecom-network
# ----------------------------
# SERVICE DISCOVERY (Eureka)
# ----------------------------
discovery-service:
build:
context: ./backend/discovery-service
container_name: ecom-discovery-service
env_file:
- ./backend/docker.env
ports:
- "${EUREKA_PORT}:${EUREKA_PORT}"
depends_on:
mongo:
condition: service_healthy
minio:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:${EUREKA_PORT}/actuator/health | grep -q '\"status\":\"UP\"'"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- ecom-network
# ----------------------------
# NETWORKS & VOLUMES
# ----------------------------
networks:
ecom-network:
driver: bridge
volumes:
mongo-data:
minio-data: