# Python 3.11 + asyncio diagnostic container for Railway
# Base image: Ubuntu 24.04 (exact match for planned bot-spawner service)
FROM ubuntu:24.04

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive

# Update package list and install dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    software-properties-common \
    && rm -rf /var/lib/apt/lists/*

# Add deadsnakes PPA for Python 3.11
RUN add-apt-repository ppa:deadsnakes/ppa && \
    apt-get update

# Install Python 3.11
RUN apt-get install -y --no-install-recommends \
    python3.11 \
    && rm -rf /var/lib/apt/lists/*

# Create app directory
WORKDIR /app

# Copy diagnostic script
COPY diagnostic.py /app/diagnostic.py

# Make script executable
RUN chmod +x /app/diagnostic.py

# Run diagnostic script on container start
CMD ["python3.11", "/app/diagnostic.py"]
