refactor, split to two versions - cli and service

This commit is contained in:
Jev
2026-05-25 23:28:24 +02:00
parent 79d86961e3
commit 7188b20797
14 changed files with 335 additions and 69 deletions
+16 -7
View File
@@ -1,9 +1,18 @@
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
# git lets hatch-vcs resolve the version from the tag in the copied .git.
RUN apt-get update && apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY pyproject.toml uv.lock* ./
RUN uv sync --group dev --no-install-project
COPY . .
RUN uv sync --group dev
RUN uv build --wheel \
&& uv export --no-dev --frozen --no-emit-project --no-hashes -o requirements.txt
FROM python:3.12-slim AS runtime
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY --from=builder /app/requirements.txt /app/dist/*.whl ./
RUN pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir --no-deps *.whl \
&& rm -f *.whl requirements.txt
USER 1000:1000
ENTRYPOINT ["python", "-m", "{{ cookiecutter.package_name }}"]