-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
42 lines (39 loc) · 945 Bytes
/
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
version: '3.8'
services:
db:
image: mysql:8.0
env_file: ./.env
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
command: >
mysqld --default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
restart: always
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u$DB_USER -p$MYSQL_ROOT_PASSWORD"]
interval: 10s
timeout: 20s
retries: 6
ports:
- "${DB_EXTERNAL_PORT}:${DB_PORT}"
volumes:
- db_data:/var/lib/mysql
app:
depends_on:
- db
build: .
restart: unless-stopped
env_file: ./.env
ports:
- "${EXTERNAL_PORT}:${PORT}"
stdin_open: true
tty: true
volumes:
- app_data:/app
volumes:
db_data:
app_data: