docker
This commit is contained in:
parent
a85c1431c8
commit
44793eb8d4
3 changed files with 59 additions and 0 deletions
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
LABEL maintainer="Philippe Loctaux <p@philippeloctaux.com>"
|
||||
|
||||
FROM clux/muslrust:1.67.0-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
|
||||
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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue