-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (88 loc) · 2.28 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
88
version: '2'
services:
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.7
container_name: elastic
restart: always
environment:
- http.host=0.0.0.0
- network.host=0.0.0.0
- transport.host=0.0.0.0
- xpack.security.enabled=false
- xpack.monitoring.enabled=false
- cluster.name=es-docker-cluster
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- './elastic-data:/var/lib/elasticsearch/data'
ports:
- 9200:9200
db:
image: 'mysql:5.7'
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: app
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- '3307:3306'
volumes:
- './db-data:/var/run/mysqld'
redis:
image: redis:latest
restart: always
ports:
- '6379:6379'
volumes:
- './redis-data:/data'
command: redis-server
environment:
REDIS_HOST: redis://127.0.0.1
REDIS_DB: 0
REDIS_PORT: 6379
rabbitmq:
image: rabbitmq:management
restart: always
ports:
- '5673:5672'
- '15673:15672'
volumes:
- './rabbitmq-data:/var/lib/rabbitmq'
command: ["bash", "-c", "chmod 400 /var/lib/rabbitmq/.erlang.cookie; rabbitmq-server"]
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
app:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rake db:create && bundle exec rake db:migrate && rails routes && rake sneakers:run WORKERS = MessageCreateWorker,ChatCreateWorker && bundle exec whenever --update-crontab && service cron start && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- '.:/app'
ports:
- '3001:3000'
depends_on:
- elastic
- rabbitmq
- db
- redis
links:
- db
- elastic
environment:
REDIS_HOST: redis
DB_USER: root
DB_NAME: chatDB
DB_PASSWORD: password
DB_HOST: db
REDIS_DB: 0
REDIS_PORT: 6379
RABBITMQ_DEFAULT_HOST: rabbitmq
RABBITMQ_DEFAULT_PORT: 5672
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ELASTICSEARCH_URL: elastic