-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·142 lines (131 loc) · 3.98 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# https://docs.docker.com/compose/compose-file/
#
# Nice management UI for Docker : https://github.com/portainer/portainer
# This creates a local (development) style installation, availble at http://http://docker.yams/yams
# Note: Requires following entry in your local /etc/hosts
# 127.0.0.1 yams_core.docker
#
version: '3'
# See https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion
networks:
default:
external:
name: webproxy
volumes:
elastic_search_volume:
driver: local
postgres_volume:
driver: local
rails_logs_volume:
driver: local
redis:
driver: local
local_cloud_storage_volume:
driver: local
services:
yams_db:
image: postgres:10.9-alpine
container_name: yams-db
networks:
- default
ports:
- ${YAMS_DB_PORT:-5432}:${YAMS_DB_PORT:-5432}
restart: unless-stopped
volumes:
- postgres_volume:/var/lib/postgresql/data
yams_web:
build:
context: .
args: # Build Arguments
RAILS_ENV: production
GITHUB_TOKEN: ${GITHUB_TOKEN}
container_name: yams-web
command: ["bundle", "exec", "puma", "-C", "config/puma.rb"]
environment:
ELASTICSEARCH_URL: http://yams_elasticsearch:9200
LOGSTASH_HOST: logstash
VIRTUAL_HOST: yams.fm
VIRTUAL_PORT: 3000
LETSENCRYPT_HOST: yams.fm
RAILS_ENV: 'production'
RACK_ENV: 'production'
RAILS_SERVE_STATIC_FILES: 'true'
RAILS_LOG_TO_STDOUT: 'true'
PUMA_PORT: 3000
REDIS_URL: redis://yams_redis:6379/0
depends_on:
- yams_db
- yams_redis
- yams_sidekiq
links:
- yams_db
- yams_redis
- yams_sidekiq
networks:
- default
ports:
- "3000:3000"
restart: unless-stopped
volumes:
- rails_logs_volume:/home/app/yams/log/
- ./config/.env:/home/app/yams/.env # Kept out of git. Linked files in config/deploy/yams.rb
- ./config/master.key:/home/app/yams/config/master.key # So Capistrano copies from server shared area to deployment area
yams_sidekiq:
build:
context: .
args:
- GITHUB_TOKEN=${GITHUB_TOKEN}
command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"]
container_name: yams-sidekiq
environment:
- ELASTICSEARCH_URL=http://yams_elasticsearch:9200
- JOB_WORKER_URL=redis://yams_redis:6379/0
- REDIS_URL=redis://yams_redis:6379/0
- RAILS_ENV=production
- YAMS_DB_HOST=yams_db
depends_on:
- yams_db
- yams_redis
links:
- yams_db
- yams_redis
networks:
- default
restart: unless-stopped
volumes:
- local_cloud_storage_volume:/home/app/yams/storage
- ./config/.env:/home/app/yams/.env # Kept out of git. Linked files in config/deploy/yams.rb
- ./config/master.key:/home/app/yams/config/master.key # So Capistrano copies from server shared area to deployment area
yams_redis:
container_name: yams-redis
image: redis:latest
ports:
- 6379:6379
networks:
- default
restart: unless-stopped
# NOTES
# The ELK images come with XPack already installed - this adds an authorisation layer we do not need,
# or at least not worth the complication at this stage. Turn it off via - xpack.security.enabled=false
yams_elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.1
container_name: yams-elasticsearch
environment:
- xpack.security.enabled=false
- xpack.monitoring.enabled=false
- xpack.ml.enabled=false
- xpack.graph.enabled=false
- xpack.watcher.enabled=false
networks:
- default
ports:
- 9200:9200
- 9300:9300
restart: unless-stopped
ulimits:
nofile:
soft: 65535
hard: 65535
volumes:
# N.B if switched for a mounted volume,then that volumes permissions must make it accessible by user/group elasticsearch.
- elastic_search_volume:/usr/share/elasticsearch/data