-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinfrastructure.yml
58 lines (57 loc) · 1.45 KB
/
infrastructure.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
# Documentation: https://gitlab.roqua.nl/roqua/playbook/blob/master/content/docker/infrastructure.yml.md
vars:
project_name: screensmart
web_port: 3000
use_roqua_logger:
dynamic_vars:
environment:
staging:
use_roqua_logger: true
production:
use_roqua_logger: true
.rails_environment: &rails_environment
RAILS_ENV: ${environment}
RACK_ENV: ${environment}
DATABASE_URL: postgres://pg:pg@${postgres_host}:5432/${project_name}
RAILS_SERVE_STATIC_FILES: true
.rails: &rails
build: .
image: registry.roqua.nl/roqua/${project_name}:${container_tag}
depends_on:
- postgres
env_files:
- .env
release:
- name: migrations
command: bundle exec rake db:migrate
- name: seeds
command: bundle exec rake db:seed
services:
web:
<<: *rails
command: bundle exec passenger start -p ${web_port}
environment:
<<: *rails_environment
PORT: ${web_port}
RAILS_LOG_TO_STDOUT_USING_ROQUA_LOGGER: ${use_roqua_logger}
restart: unless-stopped
healthcheck:
test: netstat -an | grep 0.0.0.0:${web_port} > /dev/null; if [ 0 != $$? ]; then exit 1; fi;
expose:
- ${web_port}
shell:
<<: *rails
command: bundle exec rails c
environment:
<<: *rails_environment
logging: no
postgres:
image: postgres:10
provided_by: DATABASE_URL
ports:
- 5432
healthcheck:
test: pg_isready -U postgres
environment:
POSTGRES_USER: pg
POSTGRES_PASSWORD: pg