]> git.openstreetmap.org Git - rails.git/blob - docker-compose.yml
Merge remote-tracking branch 'upstream/pull/6564'
[rails.git] / docker-compose.yml
1 services:
2   web:
3     build:
4       context: .
5     environment:
6       PIDFILE: /tmp/pids/server.pid
7     volumes:
8       - .:/app
9       # Prevent these directories from mounting so they're not shared between host OS and Docker
10       - /app/node_modules/
11       # Mount a tmp directory that will persist between runs
12       - web-tmp:/app/tmp
13       # Mount a storage directory that will persist between runs
14       - web-storage:/app/storage
15     tmpfs:
16       /tmp/pids/
17     ports:
18       - "3000:3000"
19     stdin_open: true
20     tty: true
21     command: bundle exec rails s -p 3000 -b '0.0.0.0'
22     depends_on:
23       db:
24         condition: service_healthy
25
26   db:
27     build:
28       context: .
29       dockerfile: docker/postgres/Dockerfile
30     ports:
31       - "54321:5432"
32     environment:
33       POSTGRES_HOST_AUTH_METHOD: trust
34       POSTGRES_DB: openstreetmap
35     volumes:
36       # Mount the Postgres data directory so it persists between runs
37       - db-data:/var/lib/postgresql/data
38     healthcheck:
39       test: ["CMD-SHELL", "pg_isready"]
40       interval: 5s
41       timeout: 5s
42       retries: 20
43
44 volumes:
45   web-tmp:
46   web-storage:
47   db-data: