30 lines
986 B
Docker
30 lines
986 B
Docker
# 1. Build Stage
|
|
FROM rust:1.90-bookworm as builder
|
|
|
|
WORKDIR /usr/src/app
|
|
# Copy necessary crates for compilation
|
|
COPY ./services/common-contracts /usr/src/app/services/common-contracts
|
|
COPY ./crates/workflow-context /usr/src/app/crates/workflow-context
|
|
COPY ./services/workflow-orchestrator-service /usr/src/app/services/workflow-orchestrator-service
|
|
|
|
WORKDIR /usr/src/app/services/workflow-orchestrator-service
|
|
# Build the binary
|
|
RUN cargo build
|
|
|
|
# 2. Runtime Stage
|
|
FROM debian:bookworm-slim
|
|
|
|
# Set timezone
|
|
ENV TZ=Asia/Shanghai
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
# Minimal runtime deps
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl libssl3 && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy the built binary
|
|
COPY --from=builder /usr/src/app/services/workflow-orchestrator-service/target/debug/workflow-orchestrator-service /usr/local/bin/
|
|
|
|
# Run it
|
|
ENTRYPOINT ["/usr/local/bin/workflow-orchestrator-service"]
|
|
|