Skip to content

Commit

Permalink
add healthcheck to postgres service in docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Aug 30, 2024
1 parent 7a44123 commit 1adb776
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
docker compose -f docker-compose.yaml up -d
- name: Execute tests
run: |
docker compose up -d
docker compose run paper_trail mix test test/paper_trail
docker compose run paper_trail mix test test/version
docker compose run paper_trail mix test test/uuid
Expand Down
8 changes: 7 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ services:
db:
image: postgres:16.4-alpine
environment:
POSTGRES_PASSWORD: $PGPASSWORD
PGPASSWORD: $PGPASSWORD
PGUSER: $PGUSER
POSTGRES_USER: $PGUSER
POSTGRES_PASSWORD: $PGPASSWORD
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
networks:
- backend_network
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 5s
retries: 10
paper_trail:
image: $REGISTRY/$REPO_OWNER/$DOCKER_TAG
build:
Expand Down

0 comments on commit 1adb776

Please sign in to comment.