Skip to content

Instantly share code, notes, and snippets.

@Phathdt
Created January 22, 2022 16:14
Show Gist options
  • Save Phathdt/7edafcbd8cbf24e473bd35cafa2e995e to your computer and use it in GitHub Desktop.
Save Phathdt/7edafcbd8cbf24e473bd35cafa2e995e to your computer and use it in GitHub Desktop.
healthcheck
version: "3.9"
services:
db:
image: bitnami/postgresql:14.1.0
ports:
- '5433:5432'
environment:
POSTGRESQL_USERNAME: postgres
POSTGRESQL_PASSWORD: 123123123
POSTGRESQL_DATABASE: abc
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
backend:
build: .
environment:
PORT: 3000
DATABASE_URL: postgresql://postgres:123123123@db:5432/abc?sslmode=disable
depends_on:
db:
condition: service_healthy
ports:
- 3000:3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment