-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
82 lines (80 loc) · 1.61 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: '2.3'
networks:
external:
internal:
services:
redis:
image: redis:3.0.5
command: redis-server
volumes:
- redis:/var/lib/redis/data
networks:
internal:
depends_on:
db:
condition: service_started
db:
image: mysql:5.6
restart: always
environment:
- MYSQL_ROOT_PASSWORD=admin123
- MYSQL_PASSWORD=admin123
volumes:
- db:/var/lib/mysql/data
networks:
internal:
app:
build: .
env_file:
- .env
volumes:
- .:/roomres
networks:
internal:
##
# Ensure that the database migrations are run on the appropriate database related to the RAILS_ENV running
db_migrate:
extends: app
restart: on-failure
command: >
bash -c "bundle exec rake db:create
&& bundle exec rake db:migrate"
depends_on:
db:
condition: service_started
web:
extends: app
restart: always
command: >
bash -c "rm -f tmp/pids/server.pid
&& bundle exec rails server -p 3000 -b '0.0.0.0' -e ${RAILS_ENV}"
expose:
- 3000
ports:
- 3000:3000
depends_on:
db:
condition: service_started
redis:
condition: service_started
sidekiq:
condition: service_started
db_migrate:
condition: service_started
networks:
internal:
external:
sidekiq:
extends: app
command: bundle exec sidekiq -C config/sidekiq.yml
restart: on-failure
depends_on:
db:
condition: service_started
redis:
condition: service_started
networks:
internal:
volumes:
redis:
db: