-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
33 lines (32 loc) · 981 Bytes
/
docker-compose.yml
File metadata and controls
33 lines (32 loc) · 981 Bytes
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
services:
mysql_learning:
image: mysql:${MYSQL_VERSION}
container_name: ${MYSQL_HOST}
#command: --default-authentication-plugin=mysql_native_password
restart: always
env_file:
- '.env'
environment:
- MYSQL_DATABASE=${MYSQL_DB}
- MYSQL_DATABASE_TEST=${MYSQL_DB}
- MYSQL_ROOT_USER=${MYSQL_USER}
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWD}
- MYSQL_USER=${MYSQL_USER_DEV}
- MYSQL_PASSWORD=${MYSQL_PASSWD_DEV}
ports:
- '${MYSQL_PORT}:${MYSQL_PORT}'
volumes:
- './data/db/mysql:/var/lib/mysql'
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p${MYSQL_PASSWD} --silent"]
interval: 3s
timeout: 2s
retries: 40
start_period: 20s
mysql_wait:
image: alpine:3.20
depends_on:
mysql_learning:
condition: service_healthy
command: ["sh", "-lc", "echo '✅ MySQL is healthy and accepting connections'"]
restart: "no"