Skip to content

Commit

Permalink
fix(docker): error: failed to write to file /app/uv.lock`
Browse files Browse the repository at this point in the history
Also improve Dockerfile setup
  • Loading branch information
alexpovel committed Oct 24, 2024
1 parent ff5faa3 commit a12a2d5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

0 comments on commit a12a2d5

Please sign in to comment.