Files
corrosion-admin-panel/docker/Dockerfile.api
Vantz Stockwell fd509eea96 fix: Bump Rust image to 1.85 for edition2024 support
Dependency moxcms requires edition2024 feature, stabilized in Rust 1.85.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 00:48:54 -05:00

35 lines
777 B
Docker

# Multi-stage build for Corrosion API
# Stage 1: Build the Rust binary
FROM rust:1.85-alpine AS builder
RUN apk add --no-cache musl-dev pkgconfig openssl-dev openssl-libs-static
WORKDIR /build
# Cache dependencies — copy manifests first
COPY Cargo.toml ./
COPY Cargo.lock* ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release 2>/dev/null || true
# Now copy actual source and build
COPY src/ src/
COPY migrations/ migrations/
RUN touch src/main.rs && cargo build --release
# Stage 2: Runtime image
FROM alpine:3.20
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=builder /build/target/release/corrosion-api .
COPY migrations/ migrations/
ENV RUST_LOG=corrosion_api=info,tower_http=info
EXPOSE 3000
CMD ["./corrosion-api"]