-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
62 lines (51 loc) · 1.54 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: '3.7'
services:
mysql_db:
container_name: mysql_container
image: mysql:8
command: --default-authentication-plugin=mysql_native_password
environment:
LANG: C.UTF-8
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_USER: ${MYSQL_USER:-admin}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-admin}
MYSQL_DATABASE: ${MYSQL_DATABASE:-database}
volumes:
- ./initdb:/docker-entrypoint-initdb.d
- ./mysql:/var/lib/mysql/
ports:
- ${MYSQL_PORT:-3306}:3306
restart: unless-stopped
healthcheck:
test: [ 'CMD', 'mysqladmin', 'ping', '-proot' ]
interval: 1m
timeout: 5s
retries: 5
start_period: 3m
deploy:
resources:
limits:
cpus: '1'
memory: 2G
# ============ !!!!! ============
# Start:
# docker-compose --compatibility up -d
# -------------------------------
# Access to MySQL:
# Root password: root
# URL: localhost:3306
# Database: database
# Username: admin
# Password: admin
# -------------------------------
# Stop lifted containers:
# docker-compose --compatibility stop
# -------------------------------
# Start stopped containers
# docker-compose --compatibility start
# -------------------------------
# Stop and delete containers and network:
# docker-compose --compatibility down
# -------------------------------
# Delete 'mysql' directory
# sudo rm -r mysql