zero2prod_axum/Dockerfile

21 lines
505 B
Text
Raw Normal View History

2024-02-07 12:14:51 +01:00
# Builder stage
FROM rust:1.75.0 AS builder
WORKDIR /app
RUN apt update && apt install lld clang -y
COPY . .
ENV SQLX_OFFLINE true
RUN cargo build --release
2024-02-07 12:14:51 +01:00
# Runtime stage
FROM rust:1.75.0-slim AS runtime
WORKDIR /app
# Copy the compiled binary from the builder environment
# to our runtime environment
COPY --from=builder /app/target/release/learn_axum zero2prod
# We need the configuration file at runtime!
COPY configuration configuration
ENV APP_ENVIRONMENT production
2024-02-07 12:14:51 +01:00
ENTRYPOINT ["./zero2prod"]