Automated translation of german into "Leichte Sprache"
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.

42 lines
1.4 KiB

  1. ARG PYTHON_VERSION=3.11.4
  2. FROM python:${PYTHON_VERSION}-slim AS base
  3. # Prevents Python from writing pyc files.
  4. ENV PYTHONDONTWRITEBYTECODE=1
  5. # Keeps Python from buffering stdout and stderr to avoid situations where
  6. # the application crashes without emitting any logs due to buffering.
  7. ENV PYTHONUNBUFFERED=1
  8. WORKDIR /opt/fastapiserver
  9. # Create a non-privileged user that the app will run under.
  10. # See https://docs.docker.com/go/dockerfile-user-best-practices/
  11. #ARG UID=10001
  12. #RUN adduser \
  13. # --disabled-password \
  14. # --gecos "" \
  15. # --home "/nonexistent" \
  16. # --shell "/sbin/nologin" \
  17. # --no-create-home \
  18. # --uid "${UID}" \
  19. # appuser
  20. # Download dependencies as a separate step to take advantage of Docker's caching.
  21. # Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
  22. # Leverage a bind mount to requirements.txt to avoid having to copy them into
  23. # into this layer.
  24. #RUN --mount=type=cache,target=/root/.cache/pip
  25. # --mount=type=bind,source=requirements.txt,target=requirements.txt \
  26. # python -m pip install -r requirements.txt
  27. RUN --mount=type=cache,target=/root/.cache/pip \
  28. --mount=type=bind,source=requirements.txt,target=requirements.txt \
  29. python -m pip install -r requirements.txt
  30. # Switch to the non-privileged user to run the application.
  31. #USER appuser
  32. CMD python -m uvicorn fastapi_server:app --reload --host 0.0.0.0 --port 8001
  33. #CMD /bin/sh -c "while true; do sleep 30; done"