-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
61 lines (56 loc) · 1.58 KB
/
docker-compose-prod.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: "3"
services:
python-api:
container_name: python_host
build: ./docker/python
volumes:
- .:/src
ports:
- "8000:8000" # ホストマシンのポート8000を、docker内のポート8000に接続する
environment:
PMA_HOST: db
networks:
- mysql_bridge
expose:
- "8000"
depends_on:
- mysql
mysql:
container_name: mysql_host
build: ./docker/mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: "${MYSQL_DATABASE}"
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
MYSQL_USER: "${MYSQL_USER}"
MYSQL_PASSWORD: "${MYSQL_PASSWORD}"
TZ: "Asia/Tokyo"
volumes:
- ./docker/mysql/initdb.d:/docker-entrypoint-initdb.d # 定義どおりにテーブル作成
- ./docker/mysql/conf.d:/etc/mysql/conf.d # MySQLの基本設定(文字化け対策)
- data-volume:/var/lib/mysql
restart: always
platform: linux/amd64
networks:
- mysql_bridge
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_general_ci','--default-time-zone=+09:00']
phpmyadmin:
container_name: phpmyadmin_host
depends_on:
- mysql
image: phpmyadmin/phpmyadmin
restart: always
ports:
- "8080:80" #localhost:8080 で phpMyAdmin にアクセスできます
environment:
PMA_ARBITRARY: 1
PMA_HOST: mysql_host
networks:
- mysql_bridge
# コンテナ間で通信を行うためのネットワークブリッジ
networks:
mysql_bridge:
driver: bridge
volumes:
data-volume: