-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
177 lines (169 loc) · 4.01 KB
/
docker-compose.yaml
File metadata and controls
177 lines (169 loc) · 4.01 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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
services:
app:
container_name: ${APP_NAME}.service.app
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pgrep php-fpm || exit 1"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
env_file:
- .env
depends_on:
database:
condition: service_healthy
memcached:
condition: service_started
rabbitmq:
condition: service_healthy
working_dir: /var/www/app
volumes:
- .:/var/www/app
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
nginx:
container_name: ${APP_NAME}.service.nginx
restart: unless-stopped
env_file:
- .env
depends_on:
- app
volumes:
- .:/var/www/app
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./var/log/nginx:/var/log/nginx
- frontend_dist:/var/www/app/frontend/dist
ports:
- ${NGINX_HTTP_PORTS}
- ${NGINX_HTTPS_PORTS}
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
rabbitmq:
container_name: ${APP_NAME}.service.rabbitmq
image: rabbitmq:3.13-management-alpine
restart: unless-stopped
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 3s
retries: 5
start_period: 30s
depends_on:
database:
condition: service_started
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-guest}
ports:
- "${RABBITMQ_AMQP_PORTS:-5672:5672}"
- "${RABBITMQ_MANAGEMENT_PORTS:-15672:15672}"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
supervisor:
container_name: ${APP_NAME}.service.supervisor
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "supervisorctl status | grep -v FATAL || exit 1"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
env_file:
- .env
depends_on:
app:
condition: service_started
volumes:
- .:/var/www/app
- ./docker/php/supervisor/supervisord.conf:/etc/supervisor/supervisord.conf
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
memcached:
container_name: ${APP_NAME}.service.memcached
image: memcached:1.6-alpine
restart: unless-stopped
ports:
- ${MEMCACHED_PORTS}
networks:
- app_network
database:
container_name: ${APP_NAME}.service.db
image: postgres:${POSTGRES_VERSION:-15}-alpine
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER} -d ${DATABASE_DB_NAME}"]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_DB: ${DATABASE_DB_NAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_USER: ${DATABASE_USER}
TZ: ${TIMEZONE}
ports:
- ${DATABASE_PORTS}
volumes:
- database_data:/var/lib/postgresql/data:rw
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
frontend:
container_name: ${APP_NAME}.service.frontend
build:
context: .
dockerfile: docker/node/Dockerfile
target: node_dev
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost}
restart: unless-stopped
depends_on:
app:
condition: service_started
volumes:
- ./frontend:/app
- /app/node_modules
- frontend_dist:/app/dist
ports:
- ${FRONTEND_DEV_PORT:-5173:5173}
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
env_file:
- .env
volumes:
database_data:
rabbitmq_data:
frontend_dist:
networks:
app_network: