-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (24 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
26 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# syntax=docker/dockerfile:1
# Multi-stage build for the IONe server binary.
# IONe uses runtime sqlx queries (no compile-time query! macros), so no database
# is needed at build time. Migrations are embedded via sqlx::migrate!("./migrations")
# and run on startup against DATABASE_URL.
FROM rust:1-bookworm AS builder
WORKDIR /build
# aws-lc-sys (pulled by rustls/aws-lc-rs) needs cmake + clang; libssl-dev for lettre's native-tls.
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config cmake clang libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY . .
RUN cargo build --release --bin ione
FROM debian:bookworm-slim
# ca-certificates for outbound HTTPS (USGS feed); libssl3 for lettre native-tls at runtime.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libssl3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /build/target/release/ione /usr/local/bin/ione
COPY --from=builder /build/static ./static
ENV IONE_STATIC_DIR=/app/static
EXPOSE 3000
CMD ["ione"]