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.

36 lines
854 B

  1. FROM python:3.9-slim-buster as builder
  2. COPY requirements.txt /tmp
  3. RUN \
  4. apt update && \
  5. apt install -y build-essential cargo libffi-dev libpq-dev libssl-dev python3-dev
  6. RUN pip wheel --wheel-dir /wheels -r /tmp/requirements.txt
  7. RUN pip wheel --wheel-dir /wheels uwsgi
  8. FROM python:3.9-slim-buster
  9. RUN useradd --system hc
  10. ENV PYTHONUNBUFFERED=1
  11. WORKDIR /opt/healthchecks
  12. COPY requirements.txt /tmp
  13. COPY --from=builder /wheels /wheels
  14. RUN \
  15. apt update && \
  16. apt install -y libpq5 && \
  17. rm -rf /var/apt/cache
  18. RUN pip install --no-cache /wheels/*
  19. COPY . /opt/healthchecks/
  20. RUN \
  21. rm -f /opt/healthchecks/hc/local_settings.py && \
  22. DEBUG=False SECRET_KEY=build-key ./manage.py collectstatic --noinput && \
  23. DEBUG=False SECRET_KEY=build-key ./manage.py compress
  24. USER hc
  25. CMD [ "uwsgi", "/opt/healthchecks/docker/uwsgi.ini"]