Add web-frontend, web-project-audit and web-project-scaffold-containerized-python skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
59fc08fa5f
commit
5201aa9bd5
63 changed files with 3042 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
# The image is the runtime only: Python, git and the scripts in this folder. The app's
|
||||
# source is cloned into the /srv volume on first start and updated in place by `update`,
|
||||
# so a rebuild is needed only when this folder or the Python version changes.
|
||||
ARG PYTHON_VERSION=__PYTHON__
|
||||
FROM python:${PYTHON_VERSION}-slim
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends git openssh-client tini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
RUN groupadd --gid "$GID" app \
|
||||
&& useradd --uid "$UID" --gid app --create-home --shell /usr/sbin/nologin app \
|
||||
&& mkdir -p /srv/src /srv/venv /srv/state /data \
|
||||
&& chown -R app:app /srv /data \
|
||||
&& git config --system --add safe.directory '*'
|
||||
|
||||
COPY container/lib.sh /usr/local/lib/app/lib.sh
|
||||
COPY --chmod=755 container/entrypoint.sh /usr/local/bin/entrypoint
|
||||
COPY --chmod=755 container/update.sh /usr/local/bin/update
|
||||
|
||||
ENV PATH=/srv/venv/bin:$PATH \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
DATA_DIR=/data \
|
||||
PORT=8000
|
||||
|
||||
USER app
|
||||
WORKDIR /srv/src
|
||||
EXPOSE 8000
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
|
||||
CMD python3 -c "import os, urllib.request; urllib.request.urlopen(f'http://127.0.0.1:{os.environ[\"PORT\"]}/healthz', timeout=3)"
|
||||
ENTRYPOINT ["tini", "--", "entrypoint"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue