diff --git a/Dockerfile b/Dockerfile index 1a42f5c..346046a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,14 +7,16 @@ RUN useradd -u 1000 -d ${WORKDIR} -M app RUN chown -R app:app ${WORKDIR} USER 1000 +# Cache-friendly dependency installation +COPY pyproject.toml uv.lock ./ # https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ +COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/ +RUN uv sync --locked --no-dev -# This just works... splitting this up for better caching is a pain with Python. -COPY . . -RUN uv sync --frozen +COPY ancv/ ancv/ +# Required for Google Cloud Run to auto-detect EXPOSE 8080 -ENTRYPOINT [ "uv", "run", "ancv" ] +ENTRYPOINT [ "uv", "run", "--locked", "--module", "ancv" ] CMD [ "serve", "api", "--port", "8080" ]