Skip to content

Commit

Permalink
chore: divide build and run stage
Browse files Browse the repository at this point in the history
  • Loading branch information
bufo24 committed Jul 8, 2024
1 parent 0ea6413 commit 8561948
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
FROM rust:1.78
FROM rust:1.79 as builder

WORKDIR /app

COPY ./ ./

RUN cargo build --release

FROM debian:bookworm-slim

RUN apt-get update && \
apt-get upgrade && \
apt-get install -y libsqlite3-0 libpq5 && \
apt-get clean all && \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/target/release/covclaim /usr/local/bin/covclaim
COPY --from=builder /app/.env /.env

EXPOSE 1234

CMD ["./target/release/covclaim"]
CMD ["/usr/local/bin/covclaim"]

0 comments on commit 8561948

Please sign in to comment.