fix(docker): add healthcheck and stop grace period
Watchtower waits for container to be healthy before stopping the old one. Grace period allows in-flight requests to drain on shutdown. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,4 +35,7 @@ USER svelte
|
|||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
ENV PORT=3001
|
ENV PORT=3001
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=5s --timeout=3s --start-period=15s --retries=3 \
|
||||||
|
CMD wget -qO- http://localhost:3001/ > /dev/null || exit 1
|
||||||
|
|
||||||
CMD ["node", "build"]
|
CMD ["node", "build"]
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ services:
|
|||||||
- image-cache:/data/image-cache
|
- image-cache:/data/image-cache
|
||||||
networks:
|
networks:
|
||||||
- web
|
- web
|
||||||
|
stop_grace_period: 30s
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
image-cache:
|
image-cache:
|
||||||
|
|||||||
Reference in New Issue
Block a user