-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
107 lines (107 loc) · 2.78 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
version: '3'
services:
nginx-proxy:
container_name: nginx_proxy
image: jwilder/nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./proxy/conf.d:/etc/nginx/conf.d
- ./proxy/vhost.d:/etc/nginx/vhost.d
- ./proxy/certs:/etc/nginx/certs:ro
- ./proxy/html:/usr/share/nginx/html
environment:
DEFAULT_HOST: example.com
networks:
nginx_network:
ipv4_address: 172.20.0.2
aliases:
- nginx_proxy
nginx-letsencrypt:
container_name: nginx_letsencrypt
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
environment:
NGINX_DOCKER_GEN_CONTAINER: nginx_proxy
NGINX_PROXY_CONTAINER: nginx_proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./proxy/conf.d:/etc/nginx/conf.d
- ./proxy/vhost.d:/etc/nginx/vhost.d
- ./proxy/certs:/etc/nginx/certs:rw
- ./proxy/html:/usr/share/nginx/html
networks:
nginx_network:
ipv4_address: 172.20.0.3
aliases:
- nginx_letsencrypt
examplecom:
container_name: examplecom
image: nginx:latest
restart: always
expose:
- "80"
environment:
VIRTUAL_HOST: "example.com,www.example.com"
VIRTUAL_PORT: 80
LETSENCRYPT_HOST: "example.com,www.example.com"
LETSENCRYPT_EMAIL: [email protected]
LETSENCRYPT_KEYSIZE: 2048
volumes:
- ./examplecom:/usr/share/nginx/html:ro
networks:
nginx_network:
ipv4_address: 172.20.0.4
aliases:
- examplecom
examplewp:
container_name: examplewp
image: wordpress:latest
restart: always
depends_on:
- examplewp_db
expose:
- 80
volumes:
- ./examplewp/wp:/var/www/html/
environment:
VIRTUAL_HOST: "examplewp.com, www.examplewp.com"
LETSENCRYPT_HOST: "examplewp.com, www.examplewp.com"
LETSENCRYPT_EMAIL: [email protected]
LETSENCRYPT_KEYSIZE: 2048
WORDPRESS_DB_HOST: examplewp_db:3306
WORDPRESS_DB_USER: yourusername
WORDPRESS_DB_PASSWORD: "yourpassword"
networks:
nginx_network:
ipv4_address: 172.20.0.5
aliases:
- examplewp
examplewp_db:
container_name: examplewp_db
image: mysql:5.7
restart: always
expose:
- 3306
volumes:
- ./examplewp/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "yourpassword"
MYSQL_DATABASE: wordpress
MYSQL_USER: yourusername
MYSQL_PASSWORD: "yourpassword"
networks:
nginx_network:
ipv4_address: 172.20.0.6
aliases:
- examplewp_db
networks:
example_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/24