-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdocker-compose.yml
35 lines (34 loc) · 1017 Bytes
/
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
version: "3.9"
services:
mysql-db:
container_name: mysql-db
image: mysql
environment:
TZ: Asia/Jakarta
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-pwd}
MYSQL_USER: ${MYSQL_USER:-mysql}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-pwd}
MYSQL_DATABASE: ${MYSQL_DATABASE:-users}
restart: unless-stopped
ports:
- 3306:3306
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u root --password=${MYSQL_ROOT_PASSWORD:-pwd}"]
interval: 0.5s
timeout: 10s
retries: 10
entrypoint:
sh -c "
echo 'CREATE DATABASE IF NOT EXISTS users;' > /docker-entrypoint-initdb.d/init.sql;
/usr/local/bin/docker-entrypoint.sh --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"
redis:
image: redis:latest
container_name: redis-db
restart: unless-stopped
ports:
- 6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 0.5s
timeout: 10s
retries: 5