diff --git a/Dockerfile b/Dockerfile index 6273cce..ce25c8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,10 +10,17 @@ ENV UV_COMPILE_BYTECODE=1 # Copy from the cache instead of linking since it's a mounted volume ENV UV_LINK_MODE=copy -COPY . /app +# Copy dependency files +COPY uv.lock pyproject.toml ./ +# Install the project's dependencies using the lockfile and settings +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --locked --no-install-project --no-dev + +# Then, add the rest of the project source code and install it +COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked --no-dev -CMD ["uv", "run", "--no-dev", "fastapi", "run", "src/two_chainz", "--port", "80", "--proxy-headers"] +CMD ["uv", "run", "fastapi", "run", "src/two_chainz", "--port", "80", "--proxy-headers"] diff --git a/pyproject.toml b/pyproject.toml index fa00749..3f2c409 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,4 @@ build-backend = "hatchling.build" packages = ["src/two_chainz"] [dependency-groups] -dev = [ - "pytest>=8.3.5", - "ruff>=0.11.11", -] +dev = ["httpx>=0.28.1", "pytest>=8.3.5", "ruff>=0.11.11"] diff --git a/uv.lock b/uv.lock index 93de62a..6a2d9bc 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,4 @@ version = 1 -revision = 1 requires-python = ">=3.13" [[package]] @@ -12,6 +11,7 @@ dependencies = [ [package.dev-dependencies] dev = [ + { name = "httpx" }, { name = "pytest" }, { name = "ruff" }, ] @@ -21,6 +21,7 @@ requires-dist = [{ name = "fastapi", extras = ["standard"], specifier = ">=0.115 [package.metadata.requires-dev] dev = [ + { name = "httpx", specifier = ">=0.28.1" }, { name = "pytest", specifier = ">=8.3.5" }, { name = "ruff", specifier = ">=0.11.11" }, ] @@ -61,7 +62,7 @@ name = "click" version = "8.2.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "colorama", marker = "platform_system == 'Windows'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/60/6c/8ca2efa64cf75a977a0d7fac081354553ebe483345c734fb6b6515d96bbc/click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", size = 286342 } wheels = [