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.

38 lines
988 B

  1. FROM python:3.9-slim-buster as builder
  2. COPY requirements.txt /tmp
  3. RUN apt update && apt install -y build-essential libpq-dev
  4. RUN \
  5. if [ `dpkg --print-architecture` = "armhf" ]; then \
  6. printf "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf ; \
  7. fi
  8. RUN pip wheel --wheel-dir /wheels -r /tmp/requirements.txt
  9. RUN rm -f /etc/pip.conf && pip wheel --wheel-dir /wheels uwsgi
  10. FROM python:3.9-slim-buster
  11. RUN useradd --system hc
  12. ENV PYTHONUNBUFFERED=1
  13. WORKDIR /opt/healthchecks
  14. COPY requirements.txt /tmp
  15. COPY --from=builder /wheels /wheels
  16. RUN \
  17. apt update && \
  18. apt install -y libpq5 && \
  19. rm -rf /var/apt/cache
  20. RUN pip install --no-cache /wheels/*
  21. COPY . /opt/healthchecks/
  22. RUN \
  23. rm -f /opt/healthchecks/hc/local_settings.py && \
  24. DEBUG=False SECRET_KEY=build-key ./manage.py collectstatic --noinput && \
  25. DEBUG=False SECRET_KEY=build-key ./manage.py compress
  26. USER hc
  27. CMD [ "uwsgi", "/opt/healthchecks/docker/uwsgi.ini"]