add healthcheck service
This commit is contained in:
@ -14,6 +14,12 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \
|
||||
go mod download -x && go mod verify
|
||||
COPY . .
|
||||
|
||||
FROM base as build-utils
|
||||
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
||||
go build \
|
||||
-o /go/bin/utils \
|
||||
/go/src/git.loyso.art/frx/devsim/cmd/utility/main.go
|
||||
|
||||
FROM base as build-web
|
||||
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
||||
go build \
|
||||
@ -30,10 +36,17 @@ FROM gcr.io/distroless/static-debian12@sha256:ce46866b3a5170db3b49364900fb3168dc
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build-web /go/bin/web /app/web
|
||||
COPY --from=build-utils /go/bin/utils /app/utils
|
||||
|
||||
ENV DEVSIM_HTTP_ADDR=":80"
|
||||
EXPOSE 80
|
||||
|
||||
ENV DEVSIM_MONITOR_ADDR=":8080"
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s \
|
||||
CMD ["/app/utils", "health"]
|
||||
|
||||
ENTRYPOINT ["/app/web"]
|
||||
|
||||
FROM gcr.io/distroless/static-debian12@sha256:ce46866b3a5170db3b49364900fb3168dc0833dfb46c26da5c77f22abb01d8c3 as migrator
|
||||
|
||||
Reference in New Issue
Block a user