Files
mailks/Dockerfile
T
zhenyi c4824ef261 feat(k8s): add Kubernetes Helm chart for emailks service
- Create Helm chart structure with Chart.yaml and values.yaml
- Add deployment template with container configuration and environment variables
- Implement service template for gRPC port exposure
- Add service account template with security configuration
- Include horizontal pod autoscaler template for scaling capabilities
- Add helper templates for naming and label management
- Configure SMTP settings as configurable parameters in values.yaml
- Set up resource limits and requests for container performance
- Implement liveness and readiness probes for health checks
- Add support for existing secrets and custom configurations
2026-06-07 22:59:06 +08:00

39 lines
853 B
Docker

# ---- builder ----
FROM rust:1.96-slim-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Cache dependencies
COPY Cargo.toml Cargo.lock ./
COPY build.rs ./
COPY proto/ proto/
RUN echo '' >lib.rs && \
echo 'fn main() {}' >main.rs && \
cargo build --release --bin emailks; \
rm -f lib.rs main.rs
# Build real binary
COPY . .
RUN cargo build --release --bin emailks && \
cp target/release/emailks /app/emailks
# ---- runtime ----
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/emailks /usr/local/bin/emailks
EXPOSE 50051
ENTRYPOINT ["emailks"]