-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdocker-compose.yml
108 lines (100 loc) · 2.7 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
version: '2.2'
services:
redis:
image: redis:6
hostname: redis
restart: always
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./scripts/redis.conf:/usr/local/etc/redis/redis.conf
db:
image: postgres:10.23-bullseye
restart: always
hostname: db1
# persist the database between containers by storing it in a volume
volumes:
- fablabs-postgres:/var/lib/postgresql/data
#- ./dump:/dump
#environment:
# NOTE: Postgres 9.5 stopped allowing connections without passwords.
# Enable this if needed.
#- POSTGRES_HOST_AUTH_METHOD=trust
app:
env_file: .env
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/fablabs
- /fablabs/tmp
depends_on:
- db
- redis
container_name: app
environment:
- SSL_POLICY=AWS-TLS-1-2-2017-01
- VIRTUAL_HOST=${VIRTUAL_HOST}
- VIRTUAL_PORT=${VIRTUAL_PORT}
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
ports:
- "3000:3000"
restart: always
logging:
driver: "json-file"
options:
max-size: "100m"
worker:
env_file: .env
build:
context: .
dockerfile: Dockerfile
volumes:
- /fablabs/tmp
volumes_from:
- app
command: bash -c "sleep 3 && bundle exec sidekiq -e $RAILS_ENV"
restart: always
depends_on:
- app
- db
nginx:
restart: always
image: nginx
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- "/etc/nginx/conf.d"
- "/etc/nginx/vhost.d"
- "/usr/share/nginx/html"
- "./volumes/proxy/certs:/etc/nginx/certs:ro"
nginx-gen:
restart: always
image: jwilder/docker-gen
container_name: nginx-gen
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
- "./volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro"
volumes_from:
- nginx
environment:
- SSL_POLICY=AWS-TLS-1-2-2017-01
entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
letsencrypt-nginx-proxy-companion:
restart: always
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-nginx-proxy-companion
volumes_from:
- nginx
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./volumes/proxy/certs:/etc/nginx/certs:rw"
environment:
# unset this for real certs
#- ACME_CA_URI=https://acme-staging.api.letsencrypt.org/directory
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
- NGINX_PROXY_CONTAINER=nginx
volumes:
fablabs-postgres: