-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-prod.yml
147 lines (140 loc) · 4.14 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
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
version: '3.8'
services:
wordpress:
image: ${WORDPRESS_IMAGE:-wordpress}:${WORDPRESS_PROD_VERSION:-latest}
container_name: wordpress
volumes:
- type: bind
source: ${WORDPRESS_DATA_DIR:-./wordpress-src}
target: /var/www/html
environment:
WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST:-mysql}
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME:-wordpress}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD:-W0rdpr3Ss.}
depends_on:
- mysql
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
mysql:
image: mariadb:${MARIADB_VERSION:-latest}
container_name: mysql
volumes:
- type: volume
source: mysql
target: /var/lib/mysql
volume:
nocopy: true
- type: bind
source: ${MYSQL_DATA_DIR:-./wordpress-sql}
target: /docker-entrypoint-initdb.d
read_only: true
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-password}
MYSQL_USER: ${WORDPRESS_DB_USER:-wordpress}
MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD:-W0rdpr3Ss.}
MYSQL_DATABASE: ${WORDPRESS_DB_NAME:-wordpress}
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
wordpress-cli:
image: ${WORDPRESS_IMAGE:-wordpress}:${WORDPRESS_CLI_VERSION:-latest}
volumes:
- type: bind
source: ./config/php.conf.ini
target: /usr/local/etc/php/conf.d/conf.ini
read_only: true
- type: bind
source: ${WORDPRESS_DATA_DIR:-./wordpress-src}
target: /var/www/html
environment:
WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST:-mysql}
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME:-wordpress}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD:-W0rdpr3Ss.}
WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX:-wp_}
depends_on:
- mysql
- wordpress
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: "no"
pma:
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: ${WORDPRESS_DB_HOST:-mysql}
PMA_PORT: 3306
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-password}
PMA_ABSOLUTE_URI: http://example.com/pma
depends_on:
- mysql
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
nginx:
image: nginx:${NGINX_VERSION:-latest}
container_name: nginx
ports:
- '80:80'
- '443:443'
volumes:
- type: bind
source: ${WORDPRESS_DATA_DIR:-./wordpress-src}
target: /var/www/html
- type: bind
source: ${NGINX_CONF_DIR:-./config/nginx/cfg/}
target: /etc/nginx/custom.conf.d
- type: bind
source: ${NGINX_TEMPLATE_DIR:-./config/nginx/tpl/}
target: /etc/nginx/templates/
# - type: bind
# source: ./data/certbot/conf
# target: /etc/letsencrypt
# - type: bind
# source: ./data/certbot/www
# target: /var/www/certbot
environment:
SERVER_NAME: ${SERVER_NAME:-example.com}
SERVER_ALT_NAME: ${SERVER_ALT_NAME:-www.example.com}
WP_CONTAINER_NAME: ${WP_CONTAINER_NAME:-wordpress}
SECURE_SUBNET: ${SECURE_SUBNET:-192.168.0.0/16}
depends_on:
- wordpress
# command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" #certobt
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
# certbot:
# image: certbot/certbot
# restart: unless-stopped
# volumes:
# - type: bind
# source: ./data/certbot/conf
# target: /etc/letsencrypt
# - type: bind
# source: ./data/certbot/www
# target: /var/www/certbot
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
# logging:
# driver: "json-file"
# options:
# max-size: "1m"
# max-file: "5"
volumes:
mysql: