mirror of
https://github.com/NetworkCats/rustyip.git
synced 2026-11-13 16:17:46 +00:00
31 lines
571 B
Docker
31 lines
571 B
Docker
# Build Stage
|
|
FROM rust:1.93.1-alpine3.23 AS builder
|
|
|
|
RUN apk add --no-cache musl-dev
|
|
|
|
WORKDIR /build
|
|
COPY Cargo.toml Cargo.lock build.rs ./
|
|
COPY src ./src
|
|
COPY templates ./templates
|
|
COPY static ./static
|
|
|
|
RUN cargo build --release
|
|
|
|
# Runtime Stage
|
|
FROM alpine:3.23.3
|
|
|
|
RUN apk add --no-cache ca-certificates \
|
|
&& addgroup -S -g 1001 rustyip \
|
|
&& adduser -S -u 1001 -G rustyip rustyip
|
|
|
|
COPY --from=builder /build/target/release/rustyip /usr/local/bin/rustyip
|
|
|
|
WORKDIR /app
|
|
RUN chown -R rustyip:rustyip /app
|
|
|
|
USER rustyip
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
ENTRYPOINT ["rustyip"]
|