30 lines
726 B
Docker
30 lines
726 B
Docker
# ---- Base image ----
|
|
FROM python:3.12-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies (if needed by native extensions)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
gcc \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy and install Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy plugin assets
|
|
COPY plugins/pepe/pepes.txt ./plugins/pepe/pepes.txt
|
|
|
|
# Copy the rest of the application
|
|
COPY . .
|
|
|
|
# Create a non-root user for security
|
|
RUN useradd -m -s /bin/bash botuser && chown -R botuser:botuser /app
|
|
USER botuser
|
|
|
|
# Expose nothing by default (Discord bot doesn't need a public port)
|
|
|
|
# Run the bot
|
|
CMD ["python", "main.py"]
|