-
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.
- Loading branch information
Showing
33 changed files
with
969 additions
and
1,217 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
name: Setup the repository | ||
description: Set up Python, install Poetry and the dependencies | ||
name: Set up the project | ||
description: Install uv, Python, and the project dependencies | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: pipx install poetry==1.7.1 | ||
shell: bash | ||
- uses: actions/setup-python@v5 | ||
- uses: astral-sh/setup-uv@v3 | ||
with: | ||
cache: poetry | ||
python-version: "3.9.18" | ||
- run: poetry install | ||
enable-cache: true | ||
version: "0.4.10" | ||
|
||
- run: uv python install 3.10 | ||
shell: bash | ||
|
||
- run: uv sync --locked | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
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,2 +1,3 @@ | ||
__pycache__/ | ||
.venv/ | ||
content/ |
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,22 +1,28 @@ | ||
# syntax=docker/dockerfile:1.2 | ||
# Inspired from https://github.com/astral-sh/uv-docker-example/blob/dee88a8c43be3b16b0ad58f0daee5eaee7e2157a/multistage.Dockerfile. | ||
|
||
# `--platform=linux/am64` is required to build this image on macOS with Apple Silicon until https://github.com/activeviam/jdk4py/issues/73 is done. | ||
FROM --platform=linux/amd64 python:3.9.18-slim AS builder | ||
FROM ghcr.io/astral-sh/uv:0.4.10-python3.10-bookworm-slim AS builder | ||
|
||
RUN pip install poetry==1.7.1 | ||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy | ||
|
||
COPY poetry.lock pyproject.toml ./ | ||
WORKDIR /venv | ||
|
||
RUN POETRY_VIRTUALENVS_CREATE=false poetry install --no-cache --no-root --only main --sync | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --frozen --no-dev --no-install-project | ||
|
||
FROM --platform=linux/amd64 python:3.9.18-slim AS runner | ||
# Keep this synced with the builder image. | ||
FROM python:3.10-slim-bookworm | ||
|
||
ENV ATOTI_HIDE_EULA_MESSAGE=true | ||
ENV PORT=80 | ||
COPY --from=builder /venv app | ||
|
||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages | ||
COPY app app | ||
|
||
ENTRYPOINT ["python", "-u", "-m", "app"] | ||
ENV ATOTI_HIDE_EULA_MESSAGE=true | ||
ENV PORT=80 | ||
|
||
EXPOSE $PORT | ||
|
||
CMD ["python", "-u", "-m", "app"] |
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,5 +1,3 @@ | ||
from __future__ import annotations | ||
|
||
from .config import * | ||
from .constants import * | ||
from .start_app import * | ||
from .config import Config as Config | ||
from .constants import * # noqa: F403 | ||
from .start_app import start_app as start_app |
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,7 +1,8 @@ | ||
from __future__ import annotations | ||
from urllib.parse import urlparse | ||
|
||
from . import Config, start_app | ||
|
||
with start_app(config=Config()) as session: | ||
print(f"Session listening on port {session.port}") # noqa: T201 | ||
port = urlparse(session.url) or 80 | ||
print(f"Session listening on port {port}") # noqa: T201 | ||
session.wait() |
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,5 +1,3 @@ | ||
from __future__ import annotations | ||
|
||
from enum import Enum | ||
|
||
|
||
|
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
Oops, something went wrong.