2021-11-16 15:40:32 +10:00
|
|
|
FROM rust:1.56-slim AS builder
|
2021-11-16 14:34:05 +10:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
2021-11-16 15:40:32 +10:00
|
|
|
|
2021-11-16 14:34:05 +10:00
|
|
|
ENV SQLX_OFFLINE true
|
2021-11-16 15:10:20 +10:00
|
|
|
RUN cargo build --release
|
2021-11-16 14:34:05 +10:00
|
|
|
|
2021-11-16 15:40:32 +10:00
|
|
|
FROM debian:bullseye-slim AS runtime
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Install dependancies required
|
|
|
|
RUN apt update -y && apt install -y --no-install-recommends openssl && apt autoremove -y && apt clean -y && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Copy the fully built binary and configuration to the image
|
|
|
|
COPY --from=builder /app/target/release/mail_app mail_app
|
|
|
|
COPY configuration configuration
|
2021-11-16 14:34:05 +10:00
|
|
|
ENV APP_ENVIRONMENT production
|
|
|
|
|
2021-11-16 15:40:32 +10:00
|
|
|
ENTRYPOINT ["./mail_app"]
|