Fundamental_Analysis/services/finnhub-provider-service/Dockerfile
Lv, Qi 5327e76aaa chore: 提交本轮 Rust 架构迁移相关改动
- docker-compose: 下线 Python backend/config-service,切换至 config-service-rs
- archive: 归档 legacy Python 目录至 archive/python/*
- services: 新增/更新 common-contracts、api-gateway、各 provider、report-generator-service、config-service-rs
- data-persistence-service: API/system 模块与模型/DTO 调整
- frontend: 更新 useApi 与 API 路由
- docs: 更新路线图并勾选光荣退役
- cleanup: 移除 data-distance-service 占位测试
2025-11-16 20:55:46 +08:00

32 lines
1.1 KiB
Docker

# 1. Build Stage
FROM rust:1.90 as builder
WORKDIR /usr/src/app
# Pre-build dependencies to leverage Docker layer caching
COPY ./services/common-contracts /usr/src/app/services/common-contracts
COPY ./services/finnhub-provider-service/Cargo.toml ./services/finnhub-provider-service/Cargo.lock* ./services/finnhub-provider-service/
RUN mkdir -p ./services/finnhub-provider-service/src && \
echo "fn main() {}" > ./services/finnhub-provider-service/src/main.rs && \
cargo build --release --bin finnhub-provider-service
# Copy the full source code
COPY ./services/finnhub-provider-service /usr/src/app/services/finnhub-provider-service
# Build the application
RUN cargo build --release --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
# Copy the built binary from the builder stage
COPY --from=builder /usr/src/app/target/release/finnhub-provider-service /usr/local/bin/
# Set the binary as the entrypoint
ENTRYPOINT ["/usr/local/bin/finnhub-provider-service"]