30 lines
852 B
Docker
30 lines
852 B
Docker
|
################################################################################
|
||
|
# Builder
|
||
|
################################################################################
|
||
|
FROM clux/muslrust:stable AS builder
|
||
|
|
||
|
WORKDIR /app
|
||
|
COPY . .
|
||
|
|
||
|
RUN cargo build --release
|
||
|
RUN strip target/x86_64-unknown-linux-musl/release/sip-tarpit
|
||
|
|
||
|
################################################################################
|
||
|
# Final stage
|
||
|
################################################################################
|
||
|
FROM alpine:latest
|
||
|
|
||
|
# Create a group and user
|
||
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
# Copy our build
|
||
|
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/sip-tarpit /app/sip-tarpit
|
||
|
|
||
|
# Tell docker that all future commands should run as the appuser user
|
||
|
USER appuser:appgroup
|
||
|
|
||
|
# Run
|
||
|
CMD ["/app/sip-tarpit"]
|