discord bot
All checks were successful
Build and Push Discord Bot Docker Image / build (push) Successful in 1m5s

This commit is contained in:
2025-12-26 16:21:28 +01:00
parent 7d77d6299f
commit 0cd17238d0
12 changed files with 1156 additions and 0 deletions

26
discord/Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM python:3.13-slim
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Create non-root user early
RUN useradd --create-home --shell /bin/bash discorduser
WORKDIR /app
RUN chown discorduser:discorduser /app
ENV PYTHONPATH=/app
# Copy dependency files and set ownership
COPY --chown=discorduser:discorduser pyproject.toml uv.lock ./
# Switch to non-root user before installing dependencies
USER discorduser
# Install dependencies
RUN uv sync --frozen --no-dev
# Copy application code
COPY --chown=discorduser:discorduser src ./src
CMD ["uv", "run", "--frozen", "python", "-m", "src.main"]