File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1- FROM python:3.13-slim-bookworm
1+ FROM python:3.13-slim-bookworm AS builder
22
3- # Installing/Updating system dependencies
3+ # Installing build dependencies
44RUN apt update -y && \
55 apt install -y --no-install-recommends \
6- postgresql git curl \
6+ postgresql-client git curl \
77 && rm -rf /var/lib/apt/lists/*
88
99# Install rust toolchain
@@ -14,12 +14,21 @@ WORKDIR /bot
1414
1515# Install python dependencies
1616COPY requirements.txt ./
17- RUN pip install -r requirements.txt
17+ RUN pip install --no-cache-dir -r requirements.txt
18+
19+ FROM python:3.13-slim-bookworm
20+
21+ # Copy installed Python packages from builder
22+ COPY --from=builder /usr/local /usr/local
1823
1924# Disable output buffering
2025ENV PYTHONUNBUFFERED=1
2126
2227# Copy source code
2328COPY . .
2429
30+ # Generate __pycache__ directories
31+ ENV PYTHONDONTWRITEBYTECODE=1
32+ RUN python -m compileall -q app
33+
2534CMD ["python3" , "main.py" ]
You can’t perform that action at this time.
0 commit comments