-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
145 lines (135 loc) · 3.21 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
version: "2"
services:
etcd:
image: quay.io/coreos/etcd
command: etcd --initial-cluster-state new --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://127.0.0.1:2379
volumes:
- "etcd-data:/default.etcd"
environment:
- ETCDCTL_API=3
networks:
- etcd-network
etcd_config:
build:
context: .
dockerfile: ./Dockerfile-etcd-config
volumes:
- "etcd-data:/default.etcd"
environment:
- ETCDCTL_API=3
- ETCDCTL_ENDPOINTS=etcd:2379
depends_on:
- etcd
networks:
- etcd-network
postgres:
image: "postgres"
volumes:
- "db-data:/var/lib/postgresql/data/pgdata"
env_file: .env
environment:
PGDATA: "/var/lib/postgresql/data/pgdata"
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
networks:
- postgres-network
ports:
- "5432:5432"
app:
container_name: go_oauth2_server
image: go-oauth2-server:latest
networks:
- app-network
- postgres-network
- etcd-network
depends_on:
- etcd_config
- postgres
build:
context: .
dockerfile: ./Dockerfile
ports:
- "8080"
environment:
ETCD_ENDPOINTS: "http://etcd:2379"
command: [runserver]
volumes:
- .:/go/src/github.com/RichardKnop/go-oauth2-server
- ./.gocache:/home/app/.cache/go-build
ssh-agent:
container_name: ssh-agent
image: nardeas/ssh-agent:latest
volumes:
- "dot_ssh:/root/.ssh"
- "socket_dir:/.ssh-agent"
environment:
- SSH_AUTH_SOCK=/.ssh-agent/socket
migrate-wp-user-to-oauth:
container_name: migrate-wp-user-to-oauth
image: "perl"
build: migrate-wp-users/.
depends_on:
- postgres
networks:
- postgres-network
command: [ "perl", "./migrate_wp_user_to_oauth.pl" ]
volumes:
- "dot_ssh:/root/.ssh"
- "socket_dir:/.ssh-agent"
environment:
- SSH_AUTH_SOCK=/.ssh-agent/socket
- ETCD_ENDPOINTS="http://etcd:2379"
webserver:
image: nginx:mainline-alpine
container_name: webserver
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- web-root:/var/www/html
- ./nginx-conf:/etc/nginx/conf.d
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- dhparam:/etc/ssl/certs
depends_on:
- app
networks:
- app-network
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- web-root:/var/www/html
depends_on:
- webserver
command: certonly --webroot --webroot-path=/var/www/html --email [email protected] --agree-tos --no-eff-email --force-renewal -d id.resonate.coop
networks:
app-network:
driver: bridge
postgres-network:
driver: bridge
etcd-network:
driver: bridge
volumes:
etcd-data:
db-data:
dot_ssh:
socket_dir:
certbot-etc:
certbot-var:
web-root:
driver: local
driver_opts:
type: none
device: "${PWD}/public/"
o: bind
dhparam:
driver: local
driver_opts:
type: none
device: "${PWD}/dhparam/"
o: bind