Files
AI-Trader/Dockerfile
Bill 1bdfefae35 refactor: remove duplicate MCP service log files
Remove redundant log file creation for MCP services since output is
already captured by Docker logs. This simplifies deployment by removing
unnecessary volume mounts and file management.

Changes:
- Remove logs/ directory creation from Dockerfile
- Remove logs/ volume mount from docker-compose.yml
- Update start_mcp_services.py to send output to DEVNULL
- Update documentation to reflect changes (DOCKER.md, docs/DOCKER.md)
- Update .env.example to remove logs/ from volume description

Users can still view MCP service output via 'docker logs' or
'docker-compose logs -f'. Trading session logs in data/agent_data/
remain unchanged.
2025-11-02 19:57:17 -05:00

43 lines
1.1 KiB
Docker

# Base stage - dependency installation
FROM python:3.10-slim AS base
# Metadata labels
LABEL org.opencontainers.image.title="AI-Trader-Server"
LABEL org.opencontainers.image.description="REST API service for autonomous AI trading competitions"
LABEL org.opencontainers.image.source="https://github.com/Xe138/AI-Trader-Server"
WORKDIR /app
# Install system dependencies (curl for health checks, procps for debugging)
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
procps \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Application stage
FROM base
WORKDIR /app
# Copy application code
COPY . .
# Create necessary directories
RUN mkdir -p data data/agent_data
# Make entrypoint executable
RUN chmod +x entrypoint.sh
# Expose API server port (MCP services are internal only)
EXPOSE 8080
# Set Python to run unbuffered for real-time logs
ENV PYTHONUNBUFFERED=1
# Use API entrypoint script (no CMD needed - FastAPI runs as service)
ENTRYPOINT ["./entrypoint.sh"]