- 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 占位测试
32 lines
1.1 KiB
Docker
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/yfinance-provider-service/Cargo.toml ./services/yfinance-provider-service/Cargo.lock* ./services/yfinance-provider-service/
|
|
|
|
RUN mkdir -p ./services/yfinance-provider-service/src && \
|
|
echo "fn main() {}" > ./services/yfinance-provider-service/src/main.rs && \
|
|
cargo build --release --bin yfinance-provider-service
|
|
|
|
# Copy the full source code
|
|
COPY ./services/yfinance-provider-service /usr/src/app/services/yfinance-provider-service
|
|
|
|
# Build the application
|
|
RUN cargo build --release --bin yfinance-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/yfinance-provider-service /usr/local/bin/
|
|
|
|
# Set the binary as the entrypoint
|
|
ENTRYPOINT ["/usr/local/bin/yfinance-provider-service"]
|