-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
107 lines (101 loc) · 3.01 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
102
103
104
105
106
107
# @author: kong<[email protected]>
version: '3'
networks:
common:
driver: bridge
services:
sample_web:
container_name: sample_web
build:
context: ./
dockerfile: ./docker/web/Dockerfile
#tty: true
#restart: always
depends_on:
- sample_app
links:
- sample_app
ports:
- '${WEB_PORT}:80'
- '${WEB_SSL_PORT}:443'
volumes:
# The reference setting directories
- ./docker/web/conf:/etc/nginx
# The reference folders
- ./sample-app:/var/www/sample-app
# The reference logs
- ./docker/gen/logs/nginx:/var/log/nginx
command: [nginx-debug, '-g', 'daemon off;']
networks:
- common
sample_app:
container_name: sample_app
build:
context: ./
dockerfile: ./docker/app/Dockerfile
#tty: true
#restart: always
depends_on:
- sample_db
ports:
- '${FPM_PORT}:9000'
volumes:
# The reference setting directories
- ./docker/app/conf/php.ini:/etc/php.ini
- ./docker/app/conf/www.conf:/etc/php-fpm.d/www.conf
# The reference folders
- ./sample-app:/var/www/sample-app
# The reference logs
- ./docker/gen/logs/php-fpm:/var/log/php-fpm
- ./docker/gen/logs/xhprof:/var/log/xhprof
# tmp
- ./docker/gen/tmp:/tmp
networks:
- common
sample_db:
container_name: sample_db
image: mysql:5.5.62
command: mysqld --user=root
#restart: always
#tty: true
ports:
- '${DB_PORT}:${DB_PORT}'
volumes:
# The reference setting directories
- ./docker/db/conf/my.cnf:/etc/mysql/conf.d/my.cnf
- ./docker/db/script:/docker
# The folders for dump files and migration files
- ./docker/db/dump:/dump
- ./sample-app/migrations:/migrations
################# Setting #################
# If you get an error when connecting, delete this data folder
# When this data folder exists, the following entry points are not implemented
# (that means all files are imported for only the first time)
# Delete this data folder if you want to import all your desired files from the beginning
- ./docker/gen/data:/var/lib/mysql
- ./docker/gen/logs/mysql:/var/log/mysql
################# Entry point #################
# All scripts are implemented from this folder (in the Alphabet order)
# Trick: The recommended script name is [1_ <first_action> .sh, 2_ <second_action> .sh, ...]
- ./docker/db/script:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
MYSQL_DATABASE: '${MYSQL_DATABASE}'
MYSQL_USER: '${MYSQL_USER}'
MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
networks:
- common
sample_cache:
container_name: sample_cache
image: redis
#restart: always
#tty: true
ports:
- '6379:6379'
volumes:
# The reference folders
- ./docker/gen/cache:/data
# The reference logs
- ./docker/gen/logs/redis:/var/log/redis
networks:
- common