# Build stage FROM rust:alpine AS builder RUN apk add --no-cache pkgconfig RUN apk add --no-cache openssl-dev musl-dev RUN apk add --no-cache openssl-libs-static ARG build="cargo build --release" COPY Cargo.toml /app/Cargo.toml COPY schema.sql /app/schema.sql COPY src /app/src WORKDIR "/app" RUN $build # Runtime stage FROM alpine:latest RUN apk add --no-cache libgcc RUN apk add --no-cache openssl-libs-static ARG binary="/app/target/release/server" ARG target="/usr/local/bin/server" COPY --from=builder $binary $target ENV ROCKET_ADDRESS="0.0.0.0" VOLUME ["/data"] WORKDIR "/data" CMD ["server"]