-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (75 loc) · 2.05 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
version: "3.8"
services:
redis:
image: redis:6.0.8-alpine
command: redis-server
environment:
REDIS_URL: redis://redis:6379/1
volumes:
- ./tmp/redis:/data # linking
db:
image: postgres:12.4-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: godwd_development
volumes:
- ./tmp/db:/var/lib/postgresql/data
# linking outer folder APP_ROOT(.)/tmp/db to inner folder /Var/lib.. where the data will be stored
# since we don't want this data to be stored in a container inner folder because if so it won't be persistent among container restarts
ports:
- 5432:5432
# env_file: .env
sidekiq:
build:
context: .
dockerfile: ./docker/app/Dockerfile
# command: "bundle exec sidekiq -C config/sidekiq.yml" => entrypoint.sh
volumes:
- .:/var/www/myapp:cached # linking outer . to inner /var/www/myapp
restart: always
environment:
- RAILS_ENV=$RAILS_ENV
- REDIS_URL=redis://redis:6379/1
- ENABLE_BOOTSNAP=true
depends_on:
- redis
- db
env_file: .env
command: bundle exec sidekiq -C config/sidekiq.yml
app:
build:
context: .
dockerfile: ./docker/app/Dockerfile
args:
RAILS_ENV: $RAILS_ENV
volumes:
- .:/var/www/myapp:cached
# linking inner folder /var/www/myapp to the Root . of the app
restart: always
depends_on:
- db
- redis
# command: "bundle exec puma -C config/puma.rb" => entrypoint.sh
environment:
- RAILS_ENV=development
- REDIS_URL=redis://redis:6379/1
- ENABLE_BOOTSNAP=true
- POSTGRES_PASSWORD=postgres
ports:
- "3001:3001"
# env_file: .env
web:
build:
context: .
dockerfile: ./docker/web/Dockerfile
args:
RAILS_ENV: "development"
volumes:
- .:/var/www/myapp :cached # linking inner to outer
restart: always
ports:
- 8000:80 # linking inner port 80 to outer port 8000
depends_on:
- app