ezidam/Dockerfile

32 lines
1,012 B
Docker

FROM clux/muslrust:stable as chef
USER root
RUN cargo install cargo-chef
WORKDIR /ezidam
FROM chef AS planner
COPY Cargo.toml .
COPY Cargo.lock .
COPY crates crates
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /ezidam/recipe.json recipe.json
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
COPY --from=planner /ezidam/Cargo.toml .
COPY --from=planner /ezidam/Cargo.lock .
COPY --from=planner /ezidam/crates crates
COPY logo logo
RUN cargo build --release --target x86_64-unknown-linux-musl --package ezidam --bin ezidam
FROM scratch
COPY --from=builder /ezidam/target/x86_64-unknown-linux-musl/release/ezidam /ezidam
COPY crates/ezidam/static static
COPY crates/ezidam/templates templates
ENV ROCKET_CLI_COLORS=0
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8000
ENV ROCKET_DATABASES='{ezidam={url="/database/ezidam.sqlite"}}'
EXPOSE 8000
ENTRYPOINT ["/ezidam"]
LABEL maintainer="Philippe Loctaux <p@philippeloctaux.com>"