1
0
mirror of https://github.com/TeamNewPipe/web-api synced 2025-10-06 00:02:51 +02:00
Files
web-api/Dockerfile

28 lines
895 B
Docker
Raw Permalink Normal View History

FROM python:3.13.7-slim
2018-02-11 23:03:19 +01:00
2024-12-31 12:36:35 +01:00
LABEL org.opencontainers.image.source="https://github.com/TeamNewPipe/web-api"
2018-02-11 23:03:19 +01:00
MAINTAINER "TheAssassin <theassassin@assassinate-you.net>"
# this port won't ever change, really
EXPOSE 5000
2018-02-11 23:03:19 +01:00
# create non-root user
RUN adduser app
2018-02-11 23:03:19 +01:00
USER app
WORKDIR /app
2018-02-11 23:03:19 +01:00
COPY README.md pyproject.toml poetry.lock /app/
COPY np_web_api/ /app/np_web_api/
2018-05-24 12:32:49 +02:00
# note: pip doesn't support editable (-e) installs with pyproject.toml only
RUN pip install .
2021-01-21 14:04:14 +01:00
HEALTHCHECK --interval=5m --timeout=15s \
CMD curl -f http://localhost:5000/data.json || exit 1
2018-02-11 23:03:19 +01:00
# using just one worker worked fine so far, and allows for some very crappy "synchronization" between requests by just
# using global variables, which help prevent concurrent requests to update cached data
CMD ["python", "-m", "uvicorn", "np_web_api.asgi:app", "--host", "0.0.0.0", "--port", "5000", "--workers", "1", "--no-access-log"]