Update
This commit is contained in:
parent
584c07ff23
commit
53e144d9a7
24 changed files with 1236 additions and 254 deletions
|
@ -10,6 +10,11 @@ WORKDIR /usr/src/static
|
|||
COPY --from=css /usr/src/scss/dist ./css
|
||||
RUN minify . -r -o .
|
||||
|
||||
FROM tdewolff/minify:latest as templates
|
||||
WORKDIR /usr/src/templates
|
||||
COPY ./templates .
|
||||
RUN minify . -r -o .
|
||||
|
||||
FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.67.0 as chef
|
||||
|
||||
FROM chef as diesel
|
||||
|
@ -28,11 +33,16 @@ RUN cargo chef cook --recipe-path recipe.json
|
|||
RUN rm -rf ./src
|
||||
COPY ./build.rs .
|
||||
COPY --from=static /usr/src/static ./static
|
||||
COPY ./templates ./templates
|
||||
COPY --from=templates /usr/src/templates ./templates
|
||||
COPY ./src ./src
|
||||
RUN cargo build
|
||||
|
||||
FROM docker.io/debian:bullseye-slim as runner
|
||||
LABEL maintainer="Dominic Grimm <dominic@dergrimm.net>" \
|
||||
org.opencontainers.image.description="Personal blog backend" \
|
||||
org.opencontainers.image.licenses="MIT" \
|
||||
org.opencontainers.image.source="https://git.dergrimm.net/dergrimm/blog" \
|
||||
org.opencontainers.image.url="https://git.dergrimm.net/dergrimm/blog"
|
||||
RUN apt update
|
||||
RUN apt install -y libpq5
|
||||
RUN apt install -y ca-certificates
|
||||
|
@ -40,12 +50,10 @@ RUN apt-get clean
|
|||
RUN apt-get autoremove -y
|
||||
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/
|
||||
WORKDIR /usr/local/bin
|
||||
ENV RUST_BACKTRACE=full
|
||||
COPY --from=diesel /usr/local/cargo/bin/diesel .
|
||||
WORKDIR /usr/src/backend
|
||||
COPY ./run.sh .
|
||||
RUN chmod +x ./run.sh
|
||||
COPY ./migrations ./migrations
|
||||
COPY --from=builder /usr/src/backend/target/debug/backend /usr/src/backend/target/debug/blogctl ./bin/
|
||||
EXPOSE 80
|
||||
ENTRYPOINT [ "./run.sh" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue