-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to alpine, add healthcheck command, update rust version, build…
… now optimized version.
- Loading branch information
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
FROM rust:1.70.0 as builder | ||
FROM rust:1.78.0-alpine3.19 as builder | ||
|
||
WORKDIR /usr/src/rust-tz-service | ||
COPY . . | ||
|
||
RUN --mount=type=cache,target=/usr/local/cargo/registry cargo install --path . | ||
RUN apk add libc-dev | ||
RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release | ||
|
||
FROM debian:bullseye-slim | ||
RUN apt-get update && rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder /usr/local/cargo/bin/rust-tz-service /usr/local/bin/rust-tz-service | ||
FROM alpine:3.19 | ||
RUN apk --no-cache add curl | ||
COPY --from=builder /usr/src/rust-tz-service/target/release/rust-tz-service /usr/local/bin/rust-tz-service | ||
|
||
ENV RUST_LOG=info | ||
CMD ["rust-tz-service"] | ||
HEALTHCHECK CMD curl --fail http://localhost:8080/health || exit 1 | ||
CMD rust-tz-service |