This commit is contained in:
Dominic Grimm 2022-12-20 19:00:12 +01:00
parent f13c9c905f
commit f614e606f4
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530
15 changed files with 269 additions and 214 deletions

View file

@ -7,12 +7,14 @@ COPY ./Cargo.toml ./Cargo.lock ./
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
RUN cargo install diesel_cli --no-default-features --features postgres
COPY --from=planner /usr/src/backend/recipe.json .
RUN cargo chef cook --release --recipe-path recipe.json
COPY ./src ./src
RUN cargo build --release
FROM chef as diesel
RUN cargo install diesel_cli --no-default-features --features postgres
FROM debian:buster-slim as runner
RUN apt update
RUN apt install -y libpq5
@ -21,7 +23,7 @@ RUN apt-get clean
RUN apt-get autoremove --yes
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/
WORKDIR /usr/local/bin
COPY --from=builder /usr/local/cargo/bin/diesel .
COPY --from=diesel /usr/local/cargo/bin/diesel .
WORKDIR /usr/src/backend
COPY ./run.sh .
RUN chmod +x ./run.sh