Skip to content

Migrate from poetry to uv #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.venv
.git
.github
.gitignore
.mypy_cache
.ruff_cache
build
neo.egg-info
compose.yaml
Dockerfile
.dockerignore
40 changes: 13 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
FROM python:3.10-slim

ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.8.3 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=0 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# System deps:
RUN pip install "poetry==$POETRY_VERSION"
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim

# Set working directory:
WORKDIR /code
WORKDIR /app

# Copy only requirements to cache them in docker layer
COPY poetry.lock pyproject.toml README.md /code/
# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --all-extras --frozen --no-install-project --no-dev

# Install dependencies:
RUN poetry install --no-root --without dev
# Copy the project into the image
ADD . /app

# Copy the source code:
COPY src/pop pop

# Install project:
RUN poetry install --without dev
# Sync the project
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --all-extras --frozen --no-dev

# Exposing port:
EXPOSE 8000

# Running command:
CMD ["poetry", "run", "pop"]

CMD ["uv", "run", "pop"]
Loading