-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-prod.yml
54 lines (49 loc) · 1.07 KB
/
docker-compose-prod.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
version: '3'
services:
web:
build: .
ports:
- "3000:3000"
expose:
- "3000"
dns: "8.8.8.8"
volumes:
- ".:/app"
env_file: .env
links:
- redis:redis
external_links:
- postgres:db
command: bash -c "bundle exec rake assets:precompile && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rails s"
networks:
- production
restart: always
redis:
image: redis:latest
restart: always
volumes:
- 'redis:/data'
networks:
- production
worker:
build: .
env_file: .env
restart: always
links:
- redis:redis
external_links:
- postgres:db
volumes:
- ".:/app"
command: bash -c "bundle exec sidekiq -q mailers -L log/sidekiq.log -e production"
networks:
- production
volumes:
redis:
networks:
production:
external: true
# Refer to: https://viky.co.in/2017/12/18/link-external-containers-using-docker-compose/
# Useful commands:
# docker network create production
# docker network connect production postgres