-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
45 lines (40 loc) · 1.14 KB
/
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
36
37
38
39
40
41
42
43
44
45
version: '3.9'
services:
mysql:
hostname: mysql
container_name: mysql
image: mysql:5.7
restart: unless-stopped
ports:
- 3306
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./data:/var/lib/mysql
environment:
HIST_FILE: /root/.bash_history
TZ: America/Sao_Paulo
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: loja_db
MYSQL_USER: user
MYSQL_PASSWORD: 1234
# Novo usuário:
# CREATE USER 'username'@'localhost' IDENTIFIED BY 'passwor';
# GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';
# FLUSH PRIVILEGES;
command:
- mysqld
- --explicit_defaults_for_timestamp
- --character-set-server=utf8mb4
- --skip-character-set-client-handshake
- --collation-server=utf8mb4_unicode_ci
- --skip-name-resolve
- --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
network_mode: host
logging:
driver: json-file
options:
max-size: "250m"
max-file: "10"
volumes:
data: { }