Files
aviation/api/Dockerfile
2025-04-14 22:55:32 -04:00

25 lines
484 B
Docker

# =========
# Builder
# =========
FROM rust:bookworm AS builder
WORKDIR /builder
COPY api/migrations ./migrations
COPY api/src ./src
COPY api/Cargo.toml ./
RUN apt-get update && apt-get install -y cmake
RUN cargo build --release
# =========
# Runtime
# =========
FROM debian:bookworm-slim AS runtime
WORKDIR /api
RUN apt-get update && apt-get install -y openssl libpq-dev ca-certificates
USER root
COPY --from=builder /builder/target/release/api /usr/local/bin/api
CMD ["api"]