- Multi-stage builds for all 4 services (api_gateway, backtesting, ml_training, trading) - Optimized layer caching for faster rebuilds - Reduced image sizes with cargo chef pattern - Added Dockerfile.simple for minimal testing builds - Updated docker-compose.yml with health checks - All services validated building successfully (Agent 18, 33)
22 lines
491 B
Docker
22 lines
491 B
Docker
FROM rust:1.83-slim-bookworm AS builder
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
pkg-config \
|
|
libssl-dev \
|
|
protobuf-compiler \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /build
|
|
COPY . .
|
|
|
|
RUN cargo build --release -p api_gateway
|
|
|
|
FROM debian:bookworm-slim
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
libssl3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /build/target/release/api_gateway /usr/local/bin/
|
|
CMD ["/usr/local/bin/api_gateway"]
|