discord bot
All checks were successful
Build and Push Discord Bot Docker Image / build (push) Successful in 1m5s
All checks were successful
Build and Push Discord Bot Docker Image / build (push) Successful in 1m5s
This commit is contained in:
26
discord/Dockerfile
Normal file
26
discord/Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user