-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
78 lines (72 loc) · 1.7 KB
/
docker-compose.yaml
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
services:
rest-api:
build:
context: .
dockerfile: src/api/rest/Dockerfile
image: rest-api
command: uvicorn api.rest.main:app --host 0.0.0.0 --port 8000
ports:
- "8000:8000"
volumes:
- ./.env:/rest-api/.env
depends_on:
- postgres
- redis
- email-service
- rabbitmq
email-service:
build:
context: .
dockerfile: src/services/email/Dockerfile
image: email-service
command: python -m services.email.main
depends_on:
- rabbitmq
postgres:
image: postgres:13
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
redis:
image: redis:6
ports:
- "6379:6379"
environment:
- REDIS_USERNAME=${REDIS_USERNAME}
- REDIS_PASSWORD=${REDIS_PASSWORD}
command: >
redis-server --requirepass ${REDIS_PASSWORD}
--user ${REDIS_USERNAME} on +@all >${REDIS_PASSWORD}
volumes:
- redis-data:/data
restart: always
rabbitmq:
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
volumes:
- rabbitmq-data:/var/lib/rabbitmq
restart: always
networks:
app-network:
driver: bridge
volumes:
postgres-data:
redis-data:
rabbitmq-data: