- Added services/trading_service to all Dockerfiles - Added services/ml_training_service to all Dockerfiles - Added services/api_gateway to all Dockerfiles - Added services/load_tests, stress_tests, integration_tests Cargo workspace requires all workspace members present during build. This resolves 'failed to load manifest for workspace member' errors. Note: Some service Dockerfiles have duplicate COPY statements (will clean later) Wave 125 Phase 3B - Complete workspace manifest fix
124 lines
3.7 KiB
Docker
124 lines
3.7 KiB
Docker
# =============================================================================
|
|
# FOXHUNT BACKTESTING SERVICE - DEVELOPMENT CONTAINER
|
|
# =============================================================================
|
|
# This Dockerfile creates a development-friendly container with debugging
|
|
# capabilities and data analysis tools
|
|
|
|
# =============================================================================
|
|
# BUILDER STAGE - Development Build
|
|
# =============================================================================
|
|
FROM rust:1.75-slim as backtesting-dev-builder
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
pkg-config \
|
|
libssl-dev \
|
|
ca-certificates \
|
|
libpq-dev \
|
|
protobuf-compiler \
|
|
git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Development Cargo configuration
|
|
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
|
ENV CARGO_INCREMENTAL=1
|
|
ENV CARGO_PROFILE_DEV_DEBUG=true
|
|
|
|
WORKDIR /workspace
|
|
|
|
# Copy workspace files
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY trading_engine ./trading_engine
|
|
COPY risk ./risk
|
|
COPY ml ./ml
|
|
COPY data ./data
|
|
COPY risk-data ./risk-data
|
|
COPY trading-data ./trading-data
|
|
COPY ml-data ./ml-data
|
|
COPY tli ./tli
|
|
COPY backtesting ./backtesting
|
|
COPY adaptive-strategy ./adaptive-strategy
|
|
COPY market-data ./market-data
|
|
COPY database ./database
|
|
COPY common ./common
|
|
COPY storage ./storage
|
|
COPY backtesting ./backtesting
|
|
COPY adaptive-strategy ./adaptive-strategy
|
|
COPY config ./config
|
|
COPY model_loader ./model_loader
|
|
COPY services/trading_service ./services/trading_service
|
|
COPY services/ml_training_service ./services/ml_training_service
|
|
COPY services/api_gateway ./services/api_gateway
|
|
COPY services/load_tests ./services/load_tests
|
|
COPY services/stress_tests ./services/stress_tests
|
|
COPY services/integration_tests ./services/integration_tests
|
|
COPY services/backtesting_service ./services/backtesting_service
|
|
|
|
# Build in development mode
|
|
RUN cargo build \
|
|
--package backtesting_service \
|
|
--features standalone
|
|
|
|
# =============================================================================
|
|
# DEVELOPMENT RUNTIME - Ubuntu with Analysis Tools
|
|
# =============================================================================
|
|
FROM ubuntu:22.04-slim
|
|
|
|
# Install runtime dependencies and development tools
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
libssl3 \
|
|
libpq5 \
|
|
curl \
|
|
wget \
|
|
netcat-openbsd \
|
|
# Data analysis tools
|
|
python3 \
|
|
python3-pip \
|
|
# Debug tools
|
|
gdb \
|
|
strace \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python packages for data analysis
|
|
RUN pip3 install \
|
|
pandas \
|
|
numpy \
|
|
matplotlib \
|
|
seaborn \
|
|
jupyter \
|
|
plotly \
|
|
&& rm -rf /root/.cache/pip
|
|
|
|
# Create app user and directories
|
|
RUN groupadd -r foxhunt && useradd -r -g foxhunt -s /bin/bash foxhunt
|
|
RUN mkdir -p /app/config /app/data /app/backtests /app/reports /app/logs /app/notebooks \
|
|
&& chown -R foxhunt:foxhunt /app
|
|
|
|
# Copy debug binary from builder
|
|
COPY --from=backtesting-dev-builder /workspace/target/debug/backtesting_service /app/backtesting_service
|
|
RUN chmod +x /app/backtesting_service
|
|
|
|
# Copy configuration templates
|
|
COPY services/backtesting_service/config/ /app/config/ || true
|
|
|
|
USER foxhunt
|
|
WORKDIR /app
|
|
|
|
# Expose ports for service, health check, and Jupyter
|
|
EXPOSE 50052 8082 8888
|
|
|
|
# Development environment variables
|
|
ENV RUST_LOG=debug
|
|
ENV RUST_BACKTRACE=full
|
|
ENV FOXHUNT_CONFIG=/app/config/development.toml
|
|
ENV FOXHUNT_ENV=development
|
|
ENV JUPYTER_ENABLE_LAB=yes
|
|
|
|
# Health check for development
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=45s --retries=3 \
|
|
CMD curl -f http://localhost:8082/health || exit 1
|
|
|
|
# Development startup
|
|
CMD ["./backtesting_service"] |