-
Notifications
You must be signed in to change notification settings - Fork 0
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
16 changed files
with
655 additions
and
178 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,10 +1,33 @@ | ||
venv/ | ||
.mypy_cache/ | ||
.vscode/ | ||
|
||
__pycache__/ | ||
# Application | ||
data/ | ||
|
||
.DS_Store | ||
readme.html | ||
minesweeper.md | ||
|
||
# Environnement | ||
venv/ | ||
.venv/ | ||
.env | ||
|
||
# Tools | ||
.tox/ | ||
.ruff_cache | ||
|
||
# IDEs | ||
.vscode/ | ||
|
||
.fleet/ | ||
|
||
# Builds | ||
*.egg-info/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# MacOS | ||
**/.DS_Store | ||
|
||
# Exceptions |
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,32 @@ | ||
# syntax=docker/dockerfile-upstream:master-labs | ||
|
||
FROM python:3.12.0-alpine as build | ||
FROM python:3.12-alpine AS build | ||
ARG EXTRA_DEBUG="" | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv | ||
WORKDIR /app | ||
RUN python -m venv /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
COPY ./resources ./ | ||
RUN --mount=type=cache,target=/var/cache/apk/ \ | ||
--mount=type=cache,target=/root/.cache/pip \ | ||
--mount=type=bind,source=requirements.txt,target=requirements.txt \ | ||
RUN --mount=type=cache,target=/var/cache/apk \ | ||
--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 \ | ||
: \ | ||
&& apk add gcc musl-dev linux-headers git \ | ||
&& pip install -U pip \ | ||
&& pip install -U -r requirements.txt \ | ||
&& apk update && apk add gcc musl-dev linux-headers git \ | ||
&& uv sync --no-dev --locked $EXTRA_DEBUG \ | ||
&& : | ||
|
||
FROM python:3.12.0-alpine as base | ||
COPY --parents --from=build /opt/venv / | ||
FROM python:3.12-alpine AS base | ||
# https://docs.docker.com/reference/dockerfile/#copy---parents | ||
WORKDIR /app | ||
COPY --parents --from=build /app/.venv / | ||
COPY --parents ./resources ./ | ||
COPY ./src ./ | ||
COPY --parents ./resources ./ | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
ENV PYTHONUNBUFFERED=0 | ||
|
||
FROM base as production | ||
ENV GITHUB_PROFILE_URL="https://github.com/AiroPi" | ||
FROM base AS production | ||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] | ||
|
||
|
||
FROM base as debug | ||
FROM base AS debug | ||
COPY ./debug_pages /app/debug_pages | ||
ENV DEBUG=1 | ||
ENV LOG_LEVEL=DEBUG | ||
ENV GITHUB_PROFILE_URL="http://localhost/readme.md" | ||
COPY ./readme.html ./ | ||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80", "--reload"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
services: | ||
readme-backend: | ||
image: ghcr.io/airopi/readme-backend:master | ||
environment: | ||
GITHUB_PROFILE_URL: "https://github.com/AiroPi" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.