Added healthcheck to release container
parent
6d4cf6feb6
commit
552cf4bf7b
|
@ -1,12 +1,7 @@
|
||||||
# We use a multi-stage build to end up with a very small final image
|
# We use a multi-stage build to end up with a very small final image
|
||||||
FROM alpine:latest AS builder
|
FROM alpine:latest AS builder
|
||||||
|
|
||||||
ARG MODE
|
|
||||||
ARG RUN_TESTS
|
|
||||||
|
|
||||||
ENV PATH "$PATH:/root/.cargo/bin"
|
ENV PATH "$PATH:/root/.cargo/bin"
|
||||||
# Needed for proper compiling of openssl-dev
|
|
||||||
ENV RUSTFLAGS="-C target-feature=-crt-static"
|
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
FROM chewingbever/fej-builder:latest AS builder
|
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
|
# And then finally, build the project
|
||||||
# Thank the lords that this article exists
|
# Thank the lords that this article exists
|
||||||
# https://users.rust-lang.org/t/sigsegv-with-program-linked-against-openssl-in-an-alpine-container/52172
|
# 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
|
FROM alpine:latest
|
||||||
|
|
||||||
# Install some dynamic libraries needed for everything to work
|
# 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 binary over to final image
|
||||||
COPY --from=builder /usr/local/bin/fej /usr/local/bin/fej
|
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"]
|
CMD ["/usr/local/bin/fej"]
|
||||||
|
|
Loading…
Reference in New Issue