-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
118 lines (113 loc) · 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
version: '3.8'
services:
user-service:
container_name: mailer-user-service
restart: always
build:
context: .
dockerfile: apps/user/Dockerfile
env_file:
- .env
- apps/user/.env
environment:
DB_HOST: "database"
DB_PORT: "${MAILER_DB_PORT}"
volumes:
- "/spiralover/mailer/uploads:/var/www/mailer/static/uploads"
ports:
- "${MAILER_DOCKER_DNS_PREFIX}.1:4401:4401"
- "${MAILER_DOCKER_PRIVATE_IP}:4401:4401"
networks:
- mailer-main
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- database
- redis
healthcheck:
test: [ "CMD", "curl", "-f", "http://user-service:4401/system/docker-health-check" ]
interval: 1m30s
timeout: 5s
retries: 3
start_period: 30s
executor-service:
container_name: mailer-executor-service
restart: always
build:
context: .
dockerfile: apps/executor/Dockerfile
env_file:
- .env
- apps/executor/.env
environment:
DB_HOST: "database"
DB_PORT: "${MAILER_DB_PORT}"
ports:
- "${MAILER_DOCKER_DNS_PREFIX}.1:4402:4402"
- "${MAILER_DOCKER_PRIVATE_IP}:4402:4402"
networks:
- mailer-main
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- database
- redis
healthcheck:
test: [ "CMD", "curl", "-f", "http://executor-service:4402/system/docker-health-check" ]
interval: 1m30s
timeout: 5s
retries: 3
start_period: 30s
database:
container_name: mailer-database
restart: always
image: postgres:16.1-alpine3.18
environment:
PGPORT: "${MAILER_DB_PORT}"
POSTGRES_DB: "${MAILER_DB_DATABASE}"
POSTGRES_USER: "${MAILER_DB_USERNAME}"
POSTGRES_PASSWORD: "${MAILER_DB_PASSWORD}"
volumes:
- "/spiralover/mailer/postgresql/data:/var/lib/postgresql/data"
env_file:
- .env
ports:
- "${MAILER_DOCKER_DNS_PREFIX}.1:${MAILER_DB_PORT}:${MAILER_DB_PORT}"
networks:
- mailer-main
dns:
- "${MAILER_DOCKER_DNS_PREFIX}.254"
healthcheck:
test: [ "CMD-SHELL", "sh -c 'pg_isready -U ${MAILER_DB_USERNAME} -d ${MAILER_DB_DATABASE}'" ]
interval: 1m30s
timeout: 5s
retries: 3
start_period: 30s
redis:
image: redis:7.2-alpine3.18
container_name: mailer-redis
restart: always
env_file:
- .env
volumes:
- "/spiralover/mailer/redis/data:/data"
environment:
REDIS_PASSWORD: "${MAILER_REDIS_PASSWORD}"
networks:
- mailer-main
dns:
- "${MAILER_DOCKER_DNS_PREFIX}.254"
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 1m30s
timeout: 5s
retries: 3
start_period: 30s
command: "redis-server --loglevel warning --port ${MAILER_REDIS_PORT} --requirepass '${MAILER_REDIS_PASSWORD}'"
networks:
mailer-main:
driver: bridge
ipam:
driver: default
config:
- subnet: "${MAILER_DOCKER_DNS_PREFIX}.0/24"