-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
62 lines (57 loc) · 1.3 KB
/
docker-compose.yml
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
version: '3.7'
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 30s
timeout: 10s
retries: 5
restart: always
rabbitmq:
image: "rabbitmq:management"
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
healthcheck:
test: ["CMD", "rabbitmqctl", "node_health_check"]
interval: 30s
timeout: 10s
retries: 3
restart: always
email-service:
build:
context: .
dockerfile: Dockerfile
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
env_file:
- .env
environment:
- RABBITMQ_URL=${RABBITMQ_URL}
depends_on:
rabbitmq:
condition: service_healthy
restart: always
worker-service:
build:
context: .
dockerfile: Dockerfile
command: ["./worker"]
environment:
- RABBITMQ_URL=${RABBITMQ_URL}
depends_on:
rabbitmq:
condition: service_healthy
restart: always
volumes:
db_data: