Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rhenanbartels-fix/depends_on-postgres-service'
* rhenanbartels-fix/depends_on-postgres-service: fixed ident yaml Waits for postgres service to be healthy
- Loading branch information
Showing
2 changed files
with
65 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
version: "3" | ||
services: | ||
postgres: | ||
image: postgres | ||
volumes: | ||
- "./data/postgres:/var/lib/postgresql/data" | ||
environment: | ||
- POSTGRES_USER=prest | ||
- POSTGRES_DB=prest | ||
- POSTGRES_PASSWORD=prest | ||
ports: | ||
- "5432:5432" | ||
prest: | ||
# use latest build - analyze the risk of using this version in production | ||
image: prest/prest | ||
links: | ||
- "postgres:postgres" | ||
environment: | ||
- PREST_DEBUG=false | ||
- PREST_AUTH_ENABLED=true | ||
- PREST_PG_HOST=postgres | ||
- PREST_PG_USER=prest | ||
- PREST_PG_PASS=prest | ||
- PREST_PG_DATABASE=prest | ||
- PREST_PG_PORT=5432 | ||
- PREST_SSL_MODE=disable | ||
depends_on: | ||
- postgres | ||
ports: | ||
- "3000:3000" | ||
postgres: | ||
image: postgres | ||
volumes: | ||
- "./data/postgres:/var/lib/postgresql/data" | ||
environment: | ||
- POSTGRES_USER=prest | ||
- POSTGRES_DB=prest | ||
- POSTGRES_PASSWORD=prest | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready", "-U", "prest"] | ||
interval: 30s | ||
retries: 3 | ||
prest: | ||
# use latest build - analyze the risk of using this version in production | ||
image: prest/prest | ||
links: | ||
- "postgres:postgres" | ||
environment: | ||
- PREST_DEBUG=false | ||
- PREST_AUTH_ENABLED=true | ||
- PREST_PG_HOST=postgres | ||
- PREST_PG_USER=prest | ||
- PREST_PG_PASS=prest | ||
- PREST_PG_DATABASE=prest | ||
- PREST_PG_PORT=5432 | ||
- PREST_SSL_MODE=disable | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
ports: | ||
- "3000:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
version: "3" | ||
services: | ||
postgres: | ||
image: postgres | ||
volumes: | ||
- "./data/postgres:/var/lib/postgresql/data" | ||
environment: | ||
- POSTGRES_USER=prest | ||
- POSTGRES_DB=prest | ||
- POSTGRES_PASSWORD=prest | ||
ports: | ||
- "5432:5432" | ||
prest: | ||
build: . | ||
links: | ||
- "postgres:postgres" | ||
environment: | ||
- PREST_DEBUG=true # remove comment for enable DEBUG mode (disable JWT) | ||
- PREST_PG_HOST=postgres | ||
- PREST_PG_USER=prest | ||
- PREST_PG_PASS=prest | ||
- PREST_PG_DATABASE=prest | ||
- PREST_PG_PORT=5432 | ||
- PREST_JWT_DEFAULT=false # remove if need jwt | ||
- PREST_SSL_MODE=disable | ||
depends_on: | ||
- postgres | ||
ports: | ||
- "3000:3000" | ||
postgres: | ||
image: postgres | ||
volumes: | ||
- "./data/postgres:/var/lib/postgresql/data" | ||
environment: | ||
- POSTGRES_USER=prest | ||
- POSTGRES_DB=prest | ||
- POSTGRES_PASSWORD=prest | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready", "-U", "prest"] | ||
interval: 30s | ||
retries: 3 | ||
prest: | ||
build: . | ||
links: | ||
- "postgres:postgres" | ||
environment: | ||
- PREST_DEBUG=true # remove comment for enable DEBUG mode (disable JWT) | ||
- PREST_PG_HOST=postgres | ||
- PREST_PG_USER=prest | ||
- PREST_PG_PASS=prest | ||
- PREST_PG_DATABASE=prest | ||
- PREST_PG_PORT=5432 | ||
- PREST_JWT_DEFAULT=false # remove if need jwt | ||
- PREST_SSL_MODE=disable | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
ports: | ||
- "3000:3000" |