From a1f755a6003a7920cb5488c202851f327dfe0b55 Mon Sep 17 00:00:00 2001 From: a5chin Date: Thu, 6 Jun 2024 07:50:41 +0000 Subject: [PATCH 1/2] fix: ruff version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e5e751b..4b4d959 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,5 +14,5 @@ managed = true dev-dependencies = [ "pytest>=8.2.1", "pre-commit>=3.7.0", - "ruff>=0.4.4", + "ruff>=0.4.7", ] From cb973cd3bf68464909997b0012dcaa3d693864ee Mon Sep 17 00:00:00 2001 From: a5chin Date: Thu, 6 Jun 2024 07:51:39 +0000 Subject: [PATCH 2/2] fix: Dockerfile for deploy --- Dockerfile | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57a0e83..47c4c75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,19 @@ -FROM debian:bookworm-slim as builder +ARG VARIANT=3.12 +FROM python:${VARIANT} as builder -WORKDIR /opt - -ENV RYE_HOME="/opt/rye" -ENV PATH="$RYE_HOME/shims:$PATH" - -# hadolint ignore=DL3008 -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - curl +ENV PYTHONDONTWRITEBYTECODE True -SHELL [ "/bin/bash", "-o", "pipefail", "-c" ] -RUN curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash && \ - rye config --set-bool behavior.global-python=true && \ - rye config --set-bool behavior.use-uv=true +WORKDIR /opt +COPY pyproject.toml requirements.lock ./ -COPY ./.python-version ./pyproject.toml ./requirements* ./ -RUN rye pin "$(cat .python-version)" && \ - rye sync --no-dev +# hadolint ignore=DL3013,DL3042 +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.lock -FROM debian:bookworm-slim -COPY --from=builder /opt/rye /opt/rye +FROM python:${VARIANT}-slim +COPY --from=builder /usr/local/lib/python*/site-packages /usr/local/lib/python*/site-packages -ENV RYE_HOME="/opt/rye" -ENV PATH="$RYE_HOME/shims:$PATH" ENV PYTHONUNBUFFERED True + +WORKDIR /