26 lines
1.1 KiB
Docker
26 lines
1.1 KiB
Docker
# 1. Build Stage
|
|
FROM rust:1.90-bookworm as builder
|
|
|
|
WORKDIR /usr/src/app
|
|
# Copy full sources (simple and correct; avoids shipping stub binaries)
|
|
COPY ./services/common-contracts /usr/src/app/services/common-contracts
|
|
COPY ./crates/workflow-context /usr/src/app/crates/workflow-context
|
|
COPY ./services/finnhub-provider-service /usr/src/app/services/finnhub-provider-service
|
|
WORKDIR /usr/src/app/services/finnhub-provider-service
|
|
RUN cargo build --bin finnhub-provider-service
|
|
|
|
# 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 for health checks (curl) and TLS roots if needed
|
|
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 from the builder stage
|
|
COPY --from=builder /usr/src/app/services/finnhub-provider-service/target/debug/finnhub-provider-service /usr/local/bin/
|
|
|
|
# Set the binary as the entrypoint
|
|
ENTRYPOINT ["/usr/local/bin/finnhub-provider-service"]
|