Update Dockerfile with custom base image and add
healthcheck - Update base image to `docker.io/library/alpine:3.18.4` to ensure the latest version is used. - Set the user in the container to `notatio` for security purposes. - Add a healthcheck to monitor the app's availability. - Modify the `ENTRYPOINT` to delay the execution by 10 seconds before starting the application.
This commit is contained in:
parent
9da51a1e6b
commit
c2a76ed51a
1 changed files with 6 additions and 2 deletions
|
@ -14,7 +14,8 @@ COPY . ./
|
||||||
RUN go build -o /notatio
|
RUN go build -o /notatio
|
||||||
|
|
||||||
# Stage 2: Create the final image
|
# Stage 2: Create the final image
|
||||||
FROM alpine
|
FROM docker.io/library/alpine:3.18.4
|
||||||
|
USER notatio
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
COPY --from=builder /notatio .
|
COPY --from=builder /notatio .
|
||||||
|
@ -25,5 +26,8 @@ COPY --from=builder /build/static/ static/
|
||||||
COPY --from=builder /build/wait-for-postgres.sh ./wait-for-postgres.sh
|
COPY --from=builder /build/wait-for-postgres.sh ./wait-for-postgres.sh
|
||||||
|
|
||||||
EXPOSE 9991
|
EXPOSE 9991
|
||||||
CMD ["./notatio"]
|
ENTRYPOINT ["sh", "-c", "sleep 10 && ./notatio"]
|
||||||
LABEL name=notatio version=latest
|
LABEL name=notatio version=latest
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=5m --timeout=3s \
|
||||||
|
CMD curl -f http://localhost/ || exit 1
|
Loading…
Reference in a new issue