this repo has no description
at docker 902 B view raw
1# Use the official Rust image 2FROM rust:1.82-slim as builder 3 4# Install build dependencies 5RUN apt-get update && apt-get install -y \ 6 pkg-config \ 7 libssl-dev \ 8 && rm -rf /var/lib/apt/lists/* 9 10# Set working directory 11WORKDIR /app 12 13# Copy manifest files 14COPY Cargo.toml Cargo.lock ./ 15 16# Copy source code 17COPY src ./src 18 19# Build the application 20RUN cargo build --release 21 22# Runtime stage 23FROM debian:bookworm-slim 24 25# Install runtime dependencies 26RUN apt-get update && apt-get install -y \ 27 ca-certificates \ 28 && rm -rf /var/lib/apt/lists/* 29 30# Create app user 31RUN useradd -r -s /bin/false appuser 32 33# Set working directory 34WORKDIR /app 35 36# Copy the binary from builder stage 37COPY --from=builder /app/target/release/discordhose /app/discordhose 38 39# Change ownership to app user 40RUN chown -R appuser:appuser /app 41 42# Switch to app user 43USER appuser 44 45# Run the application 46CMD ["./discordhose"]