Some checks failed
docker-images / build-and-push (admin, admin, termi-astro-admin, admin/Dockerfile) (push) Failing after 13s
docker-images / build-and-push (frontend, frontend, termi-astro-frontend, frontend/Dockerfile) (push) Has been cancelled
docker-images / build-and-push (backend, backend, termi-astro-backend, backend/Dockerfile) (push) Has been cancelled
36 lines
1.1 KiB
Docker
36 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
FROM rust:1.94-trixie AS chef
|
|
RUN cargo install cargo-chef --locked
|
|
WORKDIR /app
|
|
|
|
FROM chef AS planner
|
|
COPY . .
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
FROM chef AS builder
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
RUN cargo chef cook --release --locked --recipe-path recipe.json
|
|
|
|
COPY . .
|
|
RUN cargo build --release --locked --bin termi_api-cli
|
|
|
|
FROM debian:trixie-slim AS runtime
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates libgomp1 libstdc++6 tzdata wget \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /app/target/release/termi_api-cli /usr/local/bin/termi_api-cli
|
|
COPY --from=builder /app/config ./config
|
|
COPY --from=builder /app/assets ./assets
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
ENV RUST_LOG=info
|
|
EXPOSE 5150
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=15s --retries=5 CMD wget -q -O /dev/null http://127.0.0.1:5150/healthz || exit 1
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
CMD ["termi_api-cli", "-e", "production", "start", "--no-banner"]
|