Skip to content

Commit

Permalink
add dependencies and incorporate env vars into docker-compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro authored and haneslinger committed Feb 13, 2023
1 parent b4e909a commit df49dcb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ services:
db:
container_name: buildingmotif-db
image: postgres
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- target: 5432
published: 5432
protocol: tcp
mode: host
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
interval: 30s
timeout: 30s
retries: 5
start_period: 10s

api:
container_name: buildingmotif-api
depends_on: # require that the db is up and listening
db:
condition: service_healthy
build: .
image: buildingmotif-api:latest
ports:
Expand All @@ -22,6 +35,8 @@ services:

app:
container_name: buildingmotif-app
depends_on: # require that the api server has started
- api
build: ./buildingmotif-app
image: buildingmotif-app:latest
ports:
Expand Down

0 comments on commit df49dcb

Please sign in to comment.