-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
101 lines (96 loc) · 2.53 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: "3.8"
services:
#フロントエンド
front:
container_name: susan-liff-next_front
build:
context: ./front
dockerfile: Dockerfile
tty: true
environment:
#- CHOKIDAR_USEPOLLING=true # ホットリロードを有効にする(js)
- WATCHPACK_POLLING=true # ホットリロードを有効にする(ts)
ports:
- "3000:3000" # 開発用
- "4000:4000" # 本番用
networks:
- default
volumes:
- ./front:/home/app
- node_modules_volume:/home/app/node_modules:delegated
- build_volume:/home/app/build:nocopy
# command: yarn dev
#バックエンド
back:
container_name: susan_back
build:
context: ./back
dockerfile: Dockerfile
volumes:
- ./back:/var/www/html
- ./back/php.ini:/usr/local/etc/php/php.ini
ports:
- 80:80
environment:
- ENV=${ENV:-development}
depends_on:
- mysql
# 開発・本番環境によって .env/.htaccess を切り替える
command: >
/bin/bash -c
"if [ $$ENV = 'development' ]; then
cp /var/www/html/api/v2/.htaccess.development /var/www/html/api/v2/.htaccess;
cp /var/www/html/.env.development /var/www/html/.env;
else
cp /var/www/html/api/v2/.htaccess.production /var/www/html/api/v2/.htaccess;
cp /var/www/html/.env.production /var/www/html/.env;
fi
&& apache2-foreground"
#MySQL用コンテナ
mysql:
container_name: mysql
# for Apple Silicon Mac
platform: linux/arm64/v8
build:
context: ./mysql
dockerfile: Dockerfile
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/initdb.d:/docker-entrypoint-initdb.d
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE=$MYSQL_DATABASE
- MYSQL_USER=$MYSQL_USER
- MYSQL_PASSWORD=$MYSQL_PASSWORD
#phpMyAdmin用コンテナ
phpmyadmin:
container_name: phpMyAdmin
depends_on:
- mysql
image: phpmyadmin:latest
environment:
PMA_HOST: mysql
restart: always
ports:
- "81:80"
#ngrok(LINEbot ローカル動作確認用)
#reference: https://ngrok.com/docs/using-ngrok-with/docker/
ngrok:
image: ngrok/ngrok:latest
restart: unless-stopped
command:
- "start"
- "back"
- "--authtoken"
- "${NGROK_AUTH_TOKEN}"
- "--config"
- "/etc/ngrok.yml"
volumes:
- ./ngrok.yml:/etc/ngrok.yml
ports:
- 4040:4040
volumes:
node_modules_volume:
build_volume: