-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
95 lines (90 loc) · 2.4 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
version: '2'
services:
app:
container_name: hex_app
build: .
depends_on:
- postgres
volumes:
- ./:/app
working_dir: /app
command: bash -c "
mix deps.get --only prod
&& mix deps.compile
&& npm run deploy --prefix ./assets
&& mix phx.digest
&& mix ecto.migrate
&& mix phx.server"
environment:
- MIX_ENV=prod
- PORT=4000
- RECAPTCHA_PUBLIC_KEY=[REDACTED]
- RECAPTCHA_PRIVATE_KEY=[REDACTED]
- SMTP_SERVER=[email_server]
- SMTP_USERNAME=[email_login]
- SMTP_PASSWORD=[email_pass]
proxy:
container_name: hex_proxy
environment:
- DEFAULT_HOST=hexed.io
image: jwilder/nginx-proxy
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
logging:
options:
max-size: "200k"
max-file: "10"
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
# Increase gateway timeout.
- ./devops/proxy/proxy.conf:/etc/nginx/proxy.conf
- letsencrypt_certs:/etc/nginx/certs
- letsencrypt_challenge:/usr/share/nginx/html
- letsencrypt_vhosts:/etc/nginx/vhost.d
nginx:
container_name: hex_nginx
depends_on:
- app
environment:
- VIRTUAL_HOST=www.hexed.io,hexed.io
- LETSENCRYPT_HOST=www.hexed.io,hexed.io
- LETSENCRYPT_EMAIL=[REDACTED]
image: nginx:1.15.6-alpine
logging:
options:
max-size: "200k"
max-file: "10"
restart: always
volumes:
- ./devops/nginx/default.conf:/etc/nginx/conf.d/default.conf
letsencrypt:
container_name: hex_letsencrypt
environment:
- NGINX_PROXY_CONTAINER=hex_proxy
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- letsencrypt_certs:/etc/nginx/certs
- letsencrypt_challenge:/usr/share/nginx/html
- letsencrypt_vhosts:/etc/nginx/vhost.d
postgres:
container_name: hex_postgres
image: postgres
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "5432"
environment:
POSTGRES_DB: "hexed"
POSTGRES_USER: "hexDev"
POSTGRES_PASSWORD: "hexPassword"
volumes:
db_data:
letsencrypt_certs:
letsencrypt_challenge:
letsencrypt_vhosts: