2026-04-09 11:51:57 +02:00
|
|
|
FROM rust:alpine AS builder
|
2026-04-07 22:12:37 +02:00
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
2026-04-09 11:51:57 +02:00
|
|
|
RUN apk add --no-cache musl-dev pkgconfig openssl-dev && rustup target add x86_64-unknown-linux-musl
|
2026-04-07 22:12:37 +02:00
|
|
|
|
2026-04-09 01:43:28 +02:00
|
|
|
COPY Cargo.toml Cargo.lock ./
|
2026-04-07 22:12:37 +02:00
|
|
|
COPY crates ./crates
|
|
|
|
|
COPY apps ./apps
|
|
|
|
|
|
2026-04-09 11:51:57 +02:00
|
|
|
ENV RUSTFLAGS='-C target-feature=+crt-static'
|
|
|
|
|
RUN cargo build --release --bin graphic_designers --target x86_64-unknown-linux-musl
|
2026-04-07 22:12:37 +02:00
|
|
|
|
2026-04-09 11:51:57 +02:00
|
|
|
FROM alpine:latest AS runtime
|
2026-04-07 22:12:37 +02:00
|
|
|
|
2026-04-09 11:51:57 +02:00
|
|
|
RUN apk add --no-cache ca-certificates
|
2026-04-07 22:12:37 +02:00
|
|
|
|
2026-04-09 11:51:57 +02:00
|
|
|
RUN adduser -D -u 1000 appuser
|
2026-04-07 22:12:37 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-04-09 11:51:57 +02:00
|
|
|
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/graphic_designers ./graphic_designers
|
2026-04-07 22:12:37 +02:00
|
|
|
|
|
|
|
|
USER appuser
|
|
|
|
|
|
|
|
|
|
CMD ["./graphic_designers"]
|