-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·111 lines (103 loc) · 2.97 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·111 lines (103 loc) · 2.97 KB
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
version: '3.7'
services:
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/compression.conf:/etc/nginx/vhost.d/${VIRTUAL_HOST}_location
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/vhost.d:/etc/nginx/vhost.d
- ./nginx/html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: always
networks:
- webnetwork
nginx-gen:
image: jwilder/docker-gen
container_name: nginx-gen
volumes_from:
- nginx
volumes:
- ./nginx/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
networks:
- webnetwork
letsencrypt-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-companion
volumes_from:
- nginx
volumes:
- certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
- NGINX_PROXY_CONTAINER=nginx
depends_on:
- nginx-gen
networks:
- webnetwork
db:
image: mysql:5.7
container_name: db
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- db_data:/var/lib/mysql
restart: always
networks:
- webnetwork
wordpress:
depends_on:
- db
build:
context: .
dockerfile: wordpress/Dockerfile
container_name: wordpress
environment:
MYSQL_HOST: db:3306
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
VIRTUAL_HOST: ${VIRTUAL_HOST}
VIRTUAL_PORT: ${VIRTUAL_PORT}
LETSENCRYPT_HOST: ${VIRTUAL_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
LETSENCRYPT_TEST: ${LETSENCRYPT_TEST}
THEME_NAME: ${THEME_NAME}
PLUGINS: ${PLUGINS}
LOCALE: ${LOCALE}
SITE_TITLE: ${SITE_TITLE}
WP_USER: ${WP_USER}
WP_PASSWORD: ${WP_PASSWORD}
WP_EMAIL: ${WP_EMAIL}
volumes:
- wordpress_data:/var/www/html
- ./setup-wordpress.sh:/usr/local/bin/setup-wordpress.sh
command: /bin/bash -c "if [ ! -f /var/www/html/.setup_complete ]; then chmod +x /usr/local/bin/setup-wordpress.sh && /usr/local/bin/setup-wordpress.sh && touch /var/www/html/.setup_complete; fi && docker-entrypoint.sh apache2-foreground"
restart: unless-stopped
networks:
- webnetwork
watchtower:
image: containrrr/watchtower
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 43200 # 12 hours
networks:
webnetwork:
driver: bridge
volumes:
db_data:
wordpress_data:
certs: