forked from hoppiece/anime-tinder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
57 lines (56 loc) · 1.3 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
version: '3'
services:
app:
container_name: anime-front
# 対話モード
tty: true
# Dockerfileの場所
build:
context: ./
dockerfile: ./app/Dockerfile
working_dir: /home
# ホストOSとコンテナ内でソースコードを共有する
# cachedで高速化
volumes:
- ./:/home:cached
# コンテナ内部の3000を外部から3000でアクセスする
ports:
- 3000:3000
environment:
- HOST=0.0.0.0
flask:
build: .
depends_on:
- db
ports:
- 5000:5000
volumes:
- ./src:/src
tty: true
environment:
TZ: Asia/Tokyo
FLASK_APP: run.py
FLASK_ENV: development
command: bash -c "pip install -r requirements.txt && flask run -h 0.0.0.0"
networks:
app_net:
ipv4_address: 172.30.0.3
db:
build: ./mysql/
volumes:
- ./mysql/sqls:/docker-entrypoint-initdb.d # 初期化時に実行するSQL
- ./mysql/mysql_data:/var/lib/mysql # 永続化のためのボリュームマウント
environment:
- MYSQL_ROOT_PASSWORD=root
- TZ=Asia/Tokyo
networks:
app_net:
ipv4_address: 172.30.0.2
networks:
app_net:
name: app_net
driver: bridge
ipam:
driver: default
config:
- subnet: 172.30.0.0/24