# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Create the logs directory (optional, as the code does it, but good for permissions if needed)
RUN mkdir -p logs

# Define environment variable for unbuffered output
ENV PYTHONUNBUFFERED=1

# Run bot_history.py when the container launches
# If you want to run bot.py instead, change this line to: CMD ["python", "bot.py"]
CMD ["python", "bot.py"]