Skip to content

Commit ff94ae3

Browse files
committed
feat: Healthceck interval for Docker
1 parent d0da5ca commit ff94ae3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ EXPOSE 3000
4747
ENV DL_ENV_TYPE="selfHosted"
4848

4949
# Healthcheck
50-
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
50+
HEALTHCHECK --interval=15s --timeout=2s --start-period=5s --retries=5 \
5151
CMD wget --spider -q http://localhost:3000/api/health || exit 1
5252

5353
# Run the start script to init the database and start the app server

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ services:
2222
networks:
2323
- domain_locker_network
2424

25+
healthcheck:
26+
test: ["CMD-SHELL", "pg_isready -U ${DL_PG_USER:-postgres}"]
27+
interval: 5s
28+
timeout: 3s
29+
retries: 10
30+
2531
app:
2632
image: lissy93/domain-locker:latest # or ghcr.io/lissy93/domain-locker:latest
2733
container_name: domain-locker-app
@@ -39,6 +45,11 @@ services:
3945
- postgres
4046
networks:
4147
- domain_locker_network
48+
labels:
49+
- "traefik.enable=true"
50+
- "traefik.http.routers.domainlocker.rule=Host(`domain-locker.local`)"
51+
- "traefik.http.routers.domainlocker.entrypoints=http"
52+
- "traefik.http.services.domainlocker.loadbalancer.server.port=3000"
4253

4354
volumes:
4455
postgres_data:

0 commit comments

Comments
 (0)