Add Postgres db using docker-compose

This commit is contained in:
Dustin Pianalto 2020-04-03 12:55:12 -08:00
parent a29710bcc8
commit e190aded25
2 changed files with 28 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

27
docker-compose.yml Normal file
View File

@ -0,0 +1,27 @@
version: "3"
services:
goff-db:
image: postgres
ports:
- "5432:5432"
volumes:
- "${PWD}/postgres.conf:/etc/postgresql/postgresql.conf"
- "goff-db:/var/lib/postgresql/data:rw"
env_file: ${PWD}/.env
goff:
build:
context: .
dockerfile: "${PWD}/Dockerfile"
env_file: ${PWD}/.env
depends_on:
- goff-db
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
links:
- goff-db:goff.db
volumes:
goff-db:
external: true