-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
46 lines (44 loc) · 1.21 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
services:
database:
image: postgres:14-alpine
command: postgres -c "log_lock_waits=on" -N 1000 -c "fsync=off"
environment:
POSTGRES_PASSWORD: secret123
POSTGRES_USER: app_rails
healthcheck:
test: "pg_isready --username=app_rails"
timeout: 10s
retries: 20
ports:
- "5432:5432"
volumes:
- database_data:/var/lib/postgresql/data
# Rails app
# Configured for "development" RAILS_ENV
app-rails:
build:
context: ./app-rails
target: dev
depends_on:
database:
condition: service_healthy
env_file: ./app-rails/.env
environment:
- DB_HOST=database
- RAILS_BINDING=0.0.0.0
- RAILS_ENV=development
ports:
- 3100:3000
volumes:
- ./app-rails:/rails
# Use named volumes for directories that the container should use the guest
# machine's dir instead of the host machine's dir, which may be divergent.
# This is especially true for any dependency or temp directories.
- app_rails_nodemodules:/rails/node_modules
- app_rails_tmp:/rails/tmp
- app_rails_storage:/rails/storage
volumes:
database_data:
app_rails_nodemodules:
app_rails_tmp:
app_rails_storage: