-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·179 lines (169 loc) · 4.22 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
version: '3.8'
services:
## for POSTGRESQL database
#postgres:
# image: postgres
# container_name: postgres
# stdin_open: true
# tty: true
# restart: unless-stopped
# environment:
# POSTGRES_USER: root
# POSTGRES_PASSWORD: toor
# POSTGRES_DB: practiceDB
# ports:
# - 5432:5432
# volumes:
# - type: volume
# source: pgdata
# target: /var/lib/postgresql/data
# volume:
# nocopy: false
# healthcheck:
# test: ["CMD-SHELL", "sh -c 'pg_isready -U root -d practiceDB'"]
# interval: 30s
# timeout: 5s
# retries: 5
# start_period: 30s
## database manager
#pgadmin:
# image: dpage/pgadmin4
# container_name: pgadmin
# stdin_open: true
# tty: true
# restart: unless-stopped
# environment:
# PGADMIN_DEFAULT_EMAIL: [email protected]
# PGADMIN_DEFAULT_PASSWORD: admin
# PGADMIN_CONFIG_SERVER_MODE: 'False'
# ports:
# - 5433:80
# volumes:
# - type: volume
# source: pgadmin
# target: /var/lib/pgadmin
# volume:
# nocopy: false
# depends_on:
# - postgres
# for MYSQL database
mysql:
image: ${MYSQL_IMAGE}:${MYSQL_VERSION}
container_name: ${MYSQL_NAME}
restart: unless-stopped
stdin_open: true
tty: true
env_file:
- ".env"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ENV_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_ENV_DATABASE}
MYSQL_PASSWORD: ${MYSQL_ENV_PASSWORD}
ports:
- ${MYSQL_PORT}:3306
volumes:
- type: volume
source: mysqldata
target: /var/lib/mysql
volume:
nocopy: false
- type: bind
source: .docker/mysql/my.cnf
target: /etc/my.cnf
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-ptoor"]
interval: 30s
timeout: 5s
retries: 20
start_period: 30s
# for MYSQL administration
mysql-admin:
image: ${MYSQL_ADMIN_IMAGE}:${MYSQL_ADMIN_VERSION}
container_name: ${MYSQL_ADMIN_NAME}
restart: unless-stopped
stdin_open: true
tty: true
env_file:
- ".env"
ports:
- ${MYSQL_ADMIN_PORT}:8080
environment:
- PMA_ARBITRARY=1
#- PMA_ABSOLUTE_URI=http://localhost/manage/mysql-admin
- PMA_HOST=${MYSQL_ADMIN_MYSQL_HOST}
- PMA_PORT=${MYSQL_ADMIN_MYSQL_PORT}
volumes:
- type: volume
source: mysqladmin
target: /etc/phpmyadmin
volume:
nocopy: false
depends_on:
- ${MYSQL_NAME}
# for PHP preprocessor
php:
container_name: ${PHP_NAME}
working_dir: /SPRS
restart: unless-stopped
stdin_open: true
tty: true
env_file:
- ".env"
build:
context: .
dockerfile: .docker/php/Dockerfile
ports:
- ${PHP_PORT}:9000
volumes:
- type: bind
source: .
target: /SPRS
- type: bind
source: .docker/php/php.ini-development
target: /usr/local/etc/php/php.ini-development
- type: bind
source: .docker/php/php.ini-production
target: /usr/local/etc/php/php.ini-production
- type: bind
source: .docker/php/php-fpm.conf.default
target: /usr/local/etc/php-fpm.conf.default
- type: bind
source: .docker/php/www.conf
target: /usr/local/etc/php-fpm.d/www/conf
depends_on:
- ${MYSQL_NAME}
# for NGINX load-balancer (efficient during production)
nginx:
image: ${NGINX_IMAGE}:${NGINX_VERSION}
container_name: ${NGINX_NAME}
restart: unless-stopped
stdin_open: true
tty: true
env_file:
- ".env"
ports:
- ${NGINX_PORT}:80
volumes:
- .docker/nginx/certificates/localhost.crt:/etc/ssl/certs/localhost.crt
- .docker/nginx/certificates/localhost.key:/etc/ssl/private/localhost.key
- type: bind
source: .
target: /SPRS
- type: bind
source: .docker/nginx/default.conf
target: /etc/nginx/conf.d/default.conf
depends_on:
- ${PHP_NAME}
- ${MYSQL_ADMIN_NAME}
- ${MYSQL_NAME}
links:
- ${PHP_NAME}
- ${MYSQL_ADMIN_NAME}
networks:
default:
driver: bridge
volumes:
mysqldata:
driver: local
mysqladmin:
driver: local