-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
97 lines (89 loc) · 2.02 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
version: "2.2"
services:
db:
image: postgres:10
environment:
POSTGRES_DB: di_website
POSTGRES_USER: di_website
POSTGRES_PASSWORD: di_website_pw
restart: always
volumes:
- diwebsite_db:/var/lib/postgresql/data
networks:
- web
- consul
blue:
container_name: blue
image: diwebsite-redesign_web:blue
depends_on:
- db
expose:
- "8090"
env_file: .env
environment:
- SERVICE_8090_NAME=blue
- SERVICE_8090_TAGS=backends
volumes:
- ./:/code/
networks:
- web
- consul
green:
container_name: green
image: diwebsite-redesign_web:green
depends_on:
- db
expose:
- "8090"
env_file: .env
environment:
- SERVICE_8090_NAME=green
- SERVICE_8090_TAGS=backends
volumes:
- ./:/code/
restart: always
networks:
- web
- consul
nginx:
container_name: nginx
build: ./config/nginx/
ports:
- "80:80"
- "443:443"
volumes:
- ./assets:/assets
- ./storage:/media
- ./ssl:/etc/ssl/
- ./letsencrypt:/letsencrypt/
- ../wp-content:/wp-content
restart: always
environment:
- SERVICE_NAME=nginx
- SERVICE_TAGS=nginx
networks:
- web
- consul
certbot:
container_name: certbot
image: certbot/certbot:latest
depends_on:
- nginx
env_file: .env
environment:
- SITE_URL
- WWW_SITE_URL
- DATA_SITE_URL
entrypoint: /bin/sh -c "certbot certonly --webroot --webroot-path=/var/www/certbot --email [email protected] --agree-tos --no-eff-email -d $SITE_URL -d $WWW_SITE_URL -d $DATA_SITE_URL && trap exit TERM; while :; do certbot renew --deploy-hook /etc/letsencrypt/certbot_success.sh; sleep 12h & wait $${!}; done;"
volumes:
- ./letsencrypt:/var/www/certbot/
- ./ssl:/etc/letsencrypt/
- ./certbot_logs:/var/log/letsencrypt
volumes:
diwebsite_db:
external: true
networks:
web:
consul:
external: true
name: consul