BLOG-90 fix: update Dockerfile to use alpine base and simplify build process
All checks were successful
Frontend CI / build (push) Successful in 1m22s
Auto Comment On PR / add_improve_comment (pull_request) Successful in 17s
PR Title Check / pr-title-check (pull_request) Successful in 16s

This commit is contained in:
SquidSpirit 2025-08-06 20:02:27 +08:00
parent 08c5262df6
commit 5d686e2c71

View File

@ -1,15 +1,14 @@
FROM rust:1-slim AS base
RUN apt update -qq && apt install -y -qq --no-install-recommends musl-tools
RUN rustup target add x86_64-unknown-linux-musl
FROM rust:1-alpine AS base
RUN apk add --no-cache build-base openssl-dev openssl-libs-static
FROM base AS builder
WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl
RUN cargo build --release
FROM alpine:latest AS runner
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/server .
COPY --from=builder /app/target/release/server .
EXPOSE 8080
VOLUME ["/app/static"]
ENV RUST_LOG=info