-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
27 lines (26 loc) · 977 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
version: '3'
services:
local-db:
image: mysql:5.7
container_name: ${CONTAINER_NAME}
restart: unless-stopped
env_file: .env
environment:
- MYSQL_ROOT_PASSWORD=root
- TZ=Asia/Tokyo
networks:
- mynetwork
ports:
# Use 53306 to avoid conflict port usage on the host machine.
- 53306:3306
# `--innodb_file_format=BARRACUDA --innodb_large_prefix=1` are usually necessary with utf8mb4 for large column size.
# Each table should also use 'InnoDB ROW_FORMAT=DYNAMIC' for database engine.
# https://stackoverflow.com/questions/30761867/mysql-error-the-maximum-column-size-is-767-bytes
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --innodb_file_format=BARRACUDA --innodb_large_prefix=1
volumes:
- ${DOCKER_VOLUME_DIR}:/var/lib/mysql
# Network is required to enable container access another container.
networks:
mynetwork:
name: ${NETWORK_NAME}
external: true