-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
44 lines (41 loc) · 996 Bytes
/
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
x-api-volumes: &api-volumes
- .:/app
- ~/.ssh:/root/.ssh
- ~/.bash_history:/root/.bash_history
- ./vendor/bundle:/vendor/bundle
x-api-environment: &api-environment
- RAILS_ENV=development
- RAILS_PORT=8080
- RAILS_THREADS_COUNT=2
- RAILS_WORKERS_COUNT=2
- RAILS_SECRET_KEY_BASE=secret_key_base
- DATABASE_HOST=db
- DATABASE_USER=postgres
- DATABASE_PASSWORD=secret
services:
api:
build:
context: .
container_name: test_task_api
image: ruby-base-test_task
volumes: *api-volumes
depends_on:
- db
ports:
- "8080:8080"
environment: *api-environment
command: bash -c "bundle install && bundle exec rake db:create && bundle exec puma -C config/puma.rb -e development"
stdin_open: true
tty: true
env_file:
- ./.env
db:
image: postgres:15.5-alpine
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=secret
volumes:
- pg_data:/var/lib/postgresql/data
volumes:
pg_data: