]> git.openstreetmap.org Git - rails.git/blob - docker-compose.yml
Update storage volume configuration for docker
[rails.git] / docker-compose.yml
1 version: "3"
2
3 services:
4   web:
5     build:
6       context: .
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       - /app/tmp/
12       # Mount a storage directory that will persist between runs
13       - web-storage:/app/storage
14     ports:
15       - "3000:3000"
16     command: bundle exec rails s -p 3000 -b '0.0.0.0'
17     depends_on:
18       - db
19
20   db:
21     build:
22       context: .
23       dockerfile: docker/postgres/Dockerfile
24     ports:
25       - "54321:5432"
26     environment:
27       POSTGRES_HOST_AUTH_METHOD: trust
28       POSTGRES_DB: openstreetmap
29     volumes:
30       # Mount the Postgres data directory so it persists between runs
31       - db-data:/var/lib/postgresql/data
32
33 volumes:
34   web-storage:
35   db-data: