-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(project-setup): Switch from
poetry
to uv
, bump all dependency…
… versions to latest
- Loading branch information
Showing
13 changed files
with
1,562 additions
and
2,409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,20 @@ | ||
# Global ARG, available to all stages (if renewed) | ||
ARG WORKDIR="/app" | ||
|
||
FROM python:3.12 AS builder | ||
|
||
# Renew (https://stackoverflow.com/a/53682110): | ||
ARG WORKDIR | ||
|
||
# Don't buffer `stdout`: | ||
ENV PYTHONUNBUFFERED=1 | ||
# Don't create `.pyc` files: | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
RUN pip install poetry && poetry config virtualenvs.in-project true | ||
|
||
WORKDIR ${WORKDIR} | ||
COPY . . | ||
|
||
RUN poetry install --only main | ||
|
||
FROM python:3.12 | ||
|
||
ARG WORKDIR | ||
FROM python:3.12-slim | ||
|
||
ARG WORKDIR="/app" | ||
WORKDIR ${WORKDIR} | ||
|
||
COPY --from=builder ${WORKDIR} . | ||
|
||
RUN useradd -u 1000 -d ${WORKDIR} -M app | ||
RUN chown -R app:app ${WORKDIR} | ||
USER 1000 | ||
|
||
# App-specific settings: | ||
# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
||
# This just works... splitting this up for better caching is a pain with Python. | ||
COPY . . | ||
RUN uv sync --frozen | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT [ "./.venv/bin/python", "-m", "ancv" ] | ||
|
||
ENTRYPOINT [ "uv", "run", "ancv" ] | ||
CMD [ "serve", "api", "--port", "8080" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.