-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
45 lines (43 loc) · 1.03 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
version: "3"
services:
db:
image: postgres:9.6
ports:
- "5431:5432"
env_file:
- ".env"
environment:
- POSTGRES_PASSWORD=$YART_DATABASE_PASSWORD
- POSTGRES_USER=$YART_DATABASE_USER
volumes:
- db-data:/var/lib/postgresql/data
# To insure Postgress has booted before running the app container, along side db_socket
healthcheck:
test: pg_isready -U postgres -h 127.0.0.1
interval: 5s
app:
image: yart
build:
context: .
ports:
- "3000:3000"
env_file:
- ".env"
environment:
HISTFILE: /bash/.bash_history
volumes:
- .:/usr/src/app:cached
- ./tmp/bash/:/bash/:cached
command: sh -c "yarn install &&
bundle config set force_ruby_platform true &&
bundle check || bundle install &&
bundle exec rails db:create &&
bundle exec rails db:migrate &&
bundle exec puma -C config/puma.rb"
stdin_open: true
tty: true
depends_on:
db:
condition: service_healthy
volumes:
db-data: