A minimal statuspage to show uptime and latency for HTTP endpoints https://status.demo.j-serv.de/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

FROM python:3.8-slim
RUN pip3 install poetry
COPY poetry.lock /
COPY pyproject.toml /
# fake package to make Poetry happy (we will install the actual contents in the later stage)
RUN mkdir /statuspage && touch /statuspage/__init__.py && touch /README.md
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-dev --no-ansi
FROM python:3.8-slim
# copy pre-built packages to this image
COPY --from=0 /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
# now copy the actual code we will execute (poetry install above was just for dependencies)
COPY statuspage /statuspage
# replace build version in package and
# add build version to static asset links to break browser cache
# see also "version" in Makefile
RUN sed -i "s/^__version__ = .*/__version__ = \"${VERSION}\"/" /statuspage/__init__.py && \
sed -i "s/v=[0-9A-Za-z._-]*/v=${VERSION}/g" /statuspage/templates/base.html
ENTRYPOINT ["/usr/local/bin/python", "-m", "statuspage"]