Added healthcheck to release container

master
Jef Roosens 2021-04-12 22:55:52 +02:00
parent 6d4cf6feb6
commit 552cf4bf7b
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
2 changed files with 11 additions and 6 deletions

View File

@ -1,12 +1,7 @@
# We use a multi-stage build to end up with a very small final image
FROM alpine:latest AS builder
ARG MODE
ARG RUN_TESTS
ENV PATH "$PATH:/root/.cargo/bin"
# Needed for proper compiling of openssl-dev
ENV RUSTFLAGS="-C target-feature=-crt-static"
WORKDIR /usr/src/app

View File

@ -1,5 +1,8 @@
FROM chewingbever/fej-builder:latest AS builder
# Needed for proper compiling of openssl-dev
ENV RUSTFLAGS="-C target-feature=-crt-static"
# And then finally, build the project
# Thank the lords that this article exists
# https://users.rust-lang.org/t/sigsegv-with-program-linked-against-openssl-in-an-alpine-container/52172
@ -14,9 +17,16 @@ RUN --mount=type=cache,target=/usr/src/app/target \
FROM alpine:latest
# Install some dynamic libraries needed for everything to work
RUN apk update && apk add --no-cache openssl libgcc
RUN apk update && apk add --no-cache openssl libgcc curl
# Copy binary over to final image
COPY --from=builder /usr/local/bin/fej /usr/local/bin/fej
HEALTHCHECK \
--interval=10s \
--timeout=5s \
--start-period=1s \
--retries=3 \
CMD curl -q localhost:8000
CMD ["/usr/local/bin/fej"]