diff --git a/Dockerfile b/Dockerfile index de926ef..8e36160 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,10 @@ EXPOSE 3000 # Set environment ENV NODE_ENV=production +# add health check +HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ + CMD wget -qO- http://localhost:3000/_healthz || exit 1 + + # Start the SvelteKit app CMD ["node", "build"] diff --git a/src/routes/_healthz/+server.js b/src/routes/_healthz/+server.js new file mode 100644 index 0000000..e227d65 --- /dev/null +++ b/src/routes/_healthz/+server.js @@ -0,0 +1,3 @@ +export const GET = () => { + return new Response('ok', { status: 200 }); +};