-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
47 lines (41 loc) · 1.44 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
# Specify current major version of docker compose.
# See https://docs.docker.com/compose/compose-file/compose-versioning/
version: '3'
services:
main-db:
image: postgres:14-alpine
# Docs for options to the postgres server command:
# https://www.postgresql.org/docs/current/app-postgres.html
command: postgres -c "log_lock_waits=on" -N 1000 -c "fsync=off"
# Load environment variables for local development.
env_file: ./app/local.env
# Fix running on Apple silicon
platform: linux/amd64
ports:
- "5432:5432"
volumes:
- dbdata:/var/lib/postgresql/data
# Define one service for the application.
main-app:
# This service relies on building from a Dockerfile in this file directory,
# not on an image repository.
build: ./app
# Expose the application port for local development.
# Load environment variables for local development
env_file: ./app/local.env
# NOTE: These values take precedence if the same value is specified in the env_file.
environment:
# The env_file defines DB_HOST=localhost for accessing a non-dockerized database.
# In the docker-compose, we tell the app to use the dockerized database service
- DB_HOST=main-db
# Fix running on Apple silicon
platform: linux/amd64
ports:
- 8080:8080
# Mount application directory for local development.
volumes:
- ./app:/srv
depends_on:
- main-db
volumes:
dbdata: