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.

54 lines
985 B

6 years ago
  1. ARG BUILD_DATE=""
  2. ARG ARCH=amd64
  3. ARG PYTHON_VERSION=3
  4. # First stage
  5. FROM docker.io/${ARCH}/python:${PYTHON_VERSION}-alpine3.8 as builder
  6. # Install deps
  7. COPY requirements.txt /tmp
  8. RUN apk add --no-cache \
  9. build-base \
  10. postgresql-dev \
  11. linux-headers
  12. RUN pip install --prefix="/install" --no-warn-script-location -r /tmp/requirements.txt \
  13. braintree \
  14. uWSGI
  15. ## Second stage
  16. FROM docker.io/${ARCH}/python:${PYTHON_VERSION}-alpine3.8
  17. ENV DEBUG False
  18. ENV DB_NAME /data/hc.sqlite
  19. RUN apk add --no-cache libpq \
  20. mailcap
  21. RUN addgroup -g 900 -S healthchecks && \
  22. adduser -u 900 -S healthchecks -G healthchecks
  23. WORKDIR /app
  24. COPY --from=builder /install /usr/local
  25. COPY . .
  26. RUN ./manage.py collectstatic --noinput && \
  27. ./manage.py compress
  28. RUN mkdir /data && chown healthchecks:healthchecks /data
  29. VOLUME /data
  30. USER healthchecks
  31. EXPOSE 8000/tcp
  32. ARG SYNAPSE_VERSION
  33. ARG PYTHON_VERSION
  34. ARG BUILD_DATE
  35. CMD ["uwsgi", "--enable-threads", "uwsgi.ini"]