mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
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:
@@ -5,5 +5,9 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./docker/Dockerfile
|
dockerfile: ./docker/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- data:/app/data
|
||||||
ports:
|
ports:
|
||||||
- 4500:4500
|
- 4500:4500
|
||||||
|
volumes:
|
||||||
|
data:
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ COPY --from=builder /app/out/full/ .
|
|||||||
RUN pnpm turbo run build --filter=@morten-olsen/mini-loader-server
|
RUN pnpm turbo run build --filter=@morten-olsen/mini-loader-server
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
|
RUN apk add --no-cache jq curl
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Don't run production as root
|
# Don't run production as root
|
||||||
@@ -38,5 +39,12 @@ RUN chmod +x /entrypoint.sh
|
|||||||
|
|
||||||
COPY --from=installer /app .
|
COPY --from=installer /app .
|
||||||
EXPOSE 4500
|
EXPOSE 4500
|
||||||
|
VOLUME /app/data
|
||||||
|
|
||||||
|
HEALTHCHECK \
|
||||||
|
--interval=10s \
|
||||||
|
--start-period=10s \
|
||||||
|
CMD curl -f http://localhost:4500/health || exit 1
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["mini-loader-server", "start"]
|
CMD ["mini-loader-server", "start"]
|
||||||
Reference in New Issue
Block a user