28 lines
587 B
Docker
28 lines
587 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
gcc \
|
|
libpq-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy all project files needed for installation
|
|
COPY pyproject.toml README.md ./
|
|
COPY src/ ./src/
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir .
|
|
|
|
# Copy remaining files
|
|
COPY migrations/ ./migrations/
|
|
COPY alembic.ini ./
|
|
|
|
# Create non-root user
|
|
RUN useradd -m -u 1000 guardden && chown -R guardden:guardden /app
|
|
USER guardden
|
|
|
|
# Run the bot
|
|
CMD ["python", "-m", "guardden"]
|