-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
81 lines (80 loc) · 2.32 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
version: '2'
services:
db:
image: postgres
environment:
POSTGRES_DB: cervejator
POSTGRES_USER: cervejator
POSTGRES_PASSWORD: fakeinitialpass
redis:
image: redis:3.2
web:
build: .
environment:
RAILS_ENV: "production"
REDIS_URL: "redis://redis:6379"
SECRET_KEY_BASE: "a0489e4ef023cb859fc7de7779ade0f493d5d8e20a249a4345e9605eadcf6578b0ceb78653a671b4fa65e509d967fa0944a983c6c59af9deb4c351dc782751c1"
RAILS_SERVE_STATIC_FILES: "1" # remember to change this once we have a real web server and not rails s -- https://stackoverflow.com/questions/21969549/rails-application-css-asset-not-found-in-production-mode
entrypoint: ["/bin/bash", "/web/lib/scripts/docker_run_pending_migrations.sh"]
command: bundle exec rails s -b "0.0.0.0" -p 4000
volumes:
- /home/donato/cervejator:/web
ports:
- "4000:4000"
depends_on:
- db
- redis
- mqtt
subscriber:
build:
context: .
dockerfile: Dockerfile.subscriber
restart: always
environment:
RAILS_ENV: "production"
REDIS_URL: "redis://redis:6379"
SECRET_KEY_BASE: "a0489e4ef023cb859fc7de7779ade0f493d5d8e20a249a4345e9605eadcf6578b0ceb78653a671b4fa65e509d967fa0944a983c6c59af9deb4c351dc782751c1"
MQTT_BROKER_HOST: "mqtt"
MQTT_BROKER_PORT: "1883"
command: bundle exec rake mqtt:subscriber
volumes:
- /home/donato/cervejator:/web
depends_on:
- redis
- db
- mqtt
mqtt:
image: 'donatoaz/mymosquitto'
ports:
- "1883:1883"
- "9001:9001"
volumes:
- /home/donato/cervejator/mqtt/config:/mqtt/config:ro
- /home/donato/cervejator/mqtt/data:/mqtt/data
- /home/donato/cervejator/mqtt/log:/mqtt/log
workers:
build:
context: .
dockerfile: Dockerfile.subscriber
environment:
QUEUE: "*"
RAILS_ENV: "production"
REDIS_URL: "redis://redis:6379"
MQTT_BROKER_HOST: "mqtt"
MQTT_BROKER_PORT: "1883"
command: bundle exec rake resque:work
depends_on:
- redis
- db
scheduler:
build: .
depends_on:
- redis
- workers
command: bundle exec rake resque:scheduler
environment:
QUEUE: "*"
RAILS_ENV: "production"
REDIS_URL: "redis://redis:6379"
MQTT_BROKER_HOST: "mqtt"
MQTT_BROKER_PORT: "1883"