this repo has no description
at main 1.3 kB view raw
1# Build stage 2FROM rust:1.87-slim AS builder 3 4# Install required system dependencies for building 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 manifests first for better layer caching 14COPY Cargo.toml Cargo.lock ./ 15 16# Copy actual source code and assets 17COPY src ./src 18 19# Build the actual application with embed feature only 20RUN cargo build --release 21 22# Runtime stage using distroless 23FROM gcr.io/distroless/cc-debian12 24 25# Add OCI labels 26LABEL org.opencontainers.image.title="xrpcs-emailer" 27LABEL org.opencontainers.image.description="An ATProtocol XRPC service that sends emails for smokesignal.events" 28LABEL org.opencontainers.image.version="0.1.0" 29LABEL org.opencontainers.image.authors="Nick Gerakines <nick.gerakines@gmail.com>" 30LABEL org.opencontainers.image.source="https://tangled.sh/@smokesignal.events/xrpcs-emailer" 31LABEL org.opencontainers.image.licenses="MIT" 32 33# Set working directory 34WORKDIR /app 35 36# Copy the binary from builder stage 37COPY --from=builder /app/target/release/xrpcs-emailer /app/xrpcs-emailer 38 39# Set environment variables 40ENV HTTP_PORT=8080 41 42# Expose port 43EXPOSE 8080 44 45# Run the application 46ENTRYPOINT ["/app/xrpcs-emailer"]