devcontainer tweaks

This commit is contained in:
ThePhaseless
2025-05-17 20:50:13 +00:00
parent c608bbc46e
commit 090b5487e4
2 changed files with 16 additions and 14 deletions
+1 -5
View File
@@ -8,11 +8,7 @@
},
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"-ms-python.autopep8",
"-ms-python.vscode-pylance"
],
"extensions": ["charliermarsh.ruff", "ms-python.python"],
"settings": {
"python.venvPath": "./venv"
}
+15 -9
View File
@@ -3,15 +3,14 @@ FROM debian:bullseye-slim AS base
ARG GITHUB_BUILD=false \
VERSION
ENV HOME=/root \
GITHUB_BUILD=${GITHUB_BUILD}\
ENV GITHUB_BUILD=${GITHUB_BUILD}\
VERSION=${VERSION}\
DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
# prevents python creating .pyc files
PYTHONDONTWRITEBYTECODE=1 \
DISPLAY=:0
ENV PATH="${HOME}/.local/bin:$PATH"
DISPLAY=:0\
PATH="~/.local/bin:$PATH"
WORKDIR /app
@@ -21,20 +20,27 @@ RUN apt-get update && \
ADD https://astral.sh/uv/install.sh install.sh
RUN sh install.sh
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=${HOME}/.cache/uv uv sync
RUN --mount=type=cache,target="~/.cache/uv" uv sync
# SeleniumBase does not come with an arm64 chromedriver binary
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver
FROM base AS devcontainer
RUN apt-get install -y git && apt upgrade -y
ENV UV_LINK_MODE=copy
ENTRYPOINT [ "sleep", "infinity" ]
FROM base AS app
COPY . .
FROM base AS test
RUN --mount=type=cache,target=${HOME}/.cache/uv uv sync --group test
FROM app AS test
RUN --mount=type=cache,target=~/.cache/uv uv sync --group test
RUN ./test.sh
FROM base
FROM app
EXPOSE 8191
HEALTHCHECK --interval=15m --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "http://localhost:8191/health" ]
ENTRYPOINT ["uv", "run", "main.py"]