-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
87 lines (84 loc) · 2.2 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
services:
nginx:
build:
context: proxy
ports:
- 80:80
- 443:443
volumes:
- letsencrypt:/etc/letsencrypt:ro
- acme_challenge:/var/www/_letsencrypt
networks:
- app
restart: always
letsencrypt:
image: certbot/certbot
command: sh -c "certbot certonly --expand --webroot -w /tmp/acme_challenge -d app.fourth-strike.com --text --agree-tos --email [email protected] --rsa-key-size 4096 --verbose --non-interactive --keep-until-expiring --preferred-challenges=http"
entrypoint: ""
volumes:
- letsencrypt:/etc/letsencrypt
- acme_challenge:/tmp/acme_challenge
environment:
- TERM=xterm
restart: "no"
# TODO: doesn't work
# chrome:
# image: zenika/alpine-chrome
# command: --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 https://www.chromestatus.com/
# ports:
# - 9222:9222
# networks:
# - app
# restart: unless-stopped
app:
# build: .
image: rabidaudio/fourth-strike:latest
ports:
- 3000:3000
volumes:
- storage:/rails/storage
- cache:/rails/tmp/cache
# This works around a well-known quirk:
# https://ieftimov.com/posts/docker-compose-stray-pids-rails-beyond/
- type: tmpfs
target: /rails/tmp/pids
tmpfs:
size: "524288" # 512kb
mode: 01777 # make sure it's rw by the rails user
networks:
- app
restart: always
environment: &appenv
- RAILS_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- RAILS_LOG_LEVEL=info
- RAILS_LOG_TO_STDOUT=true
- HOSTNAME=app.fourth-strike.net
- RAILS_MIN_THREADS=1
# - CHROME_URL=http://chrome:9222
- DISCORD_CLIENT_ID
- DISCORD_CLIENT_SECRET
- RAILS_MASTER_KEY
worker:
# build: .
image: rabidaudio/fourth-strike:latest
volumes:
- storage:/rails/storage
- cache:/rails/tmp/cache
networks:
- app
restart: always
command: bundle exec rake jobs:work
environment: *appenv
volumes:
storage:
external: true
letsencrypt:
external: false
acme_challenge:
external: false
cache:
external: true
networks:
app:
driver: bridge