File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
21FROM python:3.11-slim as builder
32
4- RUN pip install uv
3+ # Install uv
4+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
55
66# Configure UV for container environment
7- ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1
8-
7+ ENV UV_COMPILE_BYTECODE=1 \
8+ UV_LINK_MODE=copy
99
1010WORKDIR /app
1111
12+ # Copy dependency files
13+ COPY pyproject.toml uv.lock ./
1214
13- COPY requirements.txt .
14-
15-
16- RUN uv pip install -r requirements.txt
17-
15+ # Install dependencies (creates an isolated virtual environment at /app/.venv)
16+ RUN uv sync --frozen --no-install-project --no-dev
1817
1918FROM gcr.io/distroless/python3-debian12
2019
2120WORKDIR /app
2221
23- COPY -- from= builder /usr/local/lib/python3.11/site-packages /app/packages
24-
22+ # Copy the dependencies from the builder's virtual environment
23+ COPY --from=builder /app/.venv/lib/python3.11/site-packages /app/packages
2524
2625COPY . .
2726
28- ENV PYTHONPATH /app/packages
29-
27+ ENV PYTHONPATH=/app/packages
3028
3129ENTRYPOINT ["python" ]
3230CMD ["main.py" ]
Original file line number Diff line number Diff line change 1+ [project ]
2+ name = " dcubabot"
3+ version = " 0.1.0"
4+ description = " Bot de Telegram del DC-UBA"
5+ readme = " README.md"
6+ requires-python = " >=3.11"
7+ dependencies = [
8+ " beautifulsoup4" ,
9+ " icalevents" ,
10+ " psycopg2-binary" ,
11+ " python-telegram-bot[webhooks]==22.0" ,
12+ " pytz" ,
13+ " requests" ,
14+ " sqlalchemy" ,
15+ " sqlalchemy-cockroachdb" ,
16+ ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments