-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Start with the official Rust image for building
FROM rust:1.75-slim-bookworm AS builder
# Install build dependencies including protobuf compiler
RUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/src/namma-push-engine
# Copy the entire workspace
COPY . .
# Build the release binary
RUN cargo build --release --bin notification-service
# Create the final runtime image
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y ca-certificates libssl3 && rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy the compiled binary from the builder
COPY --from=builder /usr/src/namma-push-engine/target/release/notification-service /usr/local/bin/
# Copy configuration
COPY notification_service.dhall /app/notification_service.dhall
ENV DHALL_CONFIG=/app/notification_service.dhall
# Expose gRPC and HTTP ports
EXPOSE 50051
EXPOSE 9091
# Run the engine
CMD ["notification-service"]