fix: add health checks and volumes to docker file (#2)

Co-authored-by: Morten Olsen <morten-olsen@users.noreply.github.com>
This commit is contained in:
Morten Olsen
2024-01-12 22:48:38 +01:00
committed by GitHub
parent fa23b325b3
commit 0760328854
2 changed files with 12 additions and 0 deletions

View File

@@ -5,5 +5,9 @@ services:
build:
context: .
dockerfile: ./docker/Dockerfile
volumes:
- data:/app/data
ports:
- 4500:4500
volumes:
data:

View File

@@ -27,6 +27,7 @@ COPY --from=builder /app/out/full/ .
RUN pnpm turbo run build --filter=@morten-olsen/mini-loader-server
FROM base AS runner
RUN apk add --no-cache jq curl
WORKDIR /app
# Don't run production as root
@@ -38,5 +39,12 @@ RUN chmod +x /entrypoint.sh
COPY --from=installer /app .
EXPOSE 4500
VOLUME /app/data
HEALTHCHECK \
--interval=10s \
--start-period=10s \
CMD curl -f http://localhost:4500/health || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["mini-loader-server", "start"]