35 أسطر
735 B
Docker
35 أسطر
735 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN python -m pip install --upgrade pip setuptools wheel \
|
|
&& pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Create logs directory
|
|
RUN mkdir -p /app/logs
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV MCP_TRANSPORT=sse
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=8000
|
|
|
|
# Build metadata
|
|
ENV BUILD_DATE=2025-11-22
|
|
ENV VERSION=2.0
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
|
CMD python -c "import socket; s=socket.socket(); s.settimeout(2); s.connect(('localhost', 8000)); s.close()" || exit 1
|
|
|
|
# Run with python directly
|
|
CMD ["python", "-u", "main.py"]
|