Dockerfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM python:3-alpine AS base
  2. LABEL MAINTAINER="heckyel@riseup.net"
  3. # Image to Build Dependencies
  4. FROM base AS builder
  5. ENV LANG C.UTF-8
  6. ENV LC_ALL C.UTF-8
  7. RUN apk add --no-cache musl-dev build-base make gcc g++ \
  8. libxml2-dev libffi-dev zlib-dev libjpeg lcms2-dev libimagequant-dev \
  9. libjpeg-turbo-dev libwebp-dev openjpeg-dev tk-dev py3-pillow libpq-dev
  10. ARG APP_DIR="/srv/app"
  11. RUN mkdir --parents "$APP_DIR"
  12. WORKDIR "$APP_DIR"
  13. COPY requirements_prod.txt .
  14. RUN pip install --no-cache-dir --prefix=/install wheel gunicorn
  15. RUN pip install --no-cache-dir --prefix=/install -r requirements_prod.txt
  16. # Runtime Environment Image
  17. FROM base
  18. WORKDIR /srv/app
  19. # Runtime Dependencies
  20. RUN apk add py3-olefile brotli-libs libpng freetype libxcb \
  21. libimagequant libjpeg-turbo lcms2 openjpeg libwebp zstd-libs \
  22. tiff libxau libmd libbsd libxdmcp libpq sassc nginx
  23. COPY --from=builder /install /usr/local
  24. COPY core/ /srv/app/core
  25. COPY personalsite/ /srv/app/personalsite
  26. COPY project/ /srv/app/project
  27. COPY social/ /srv/app/social
  28. COPY manage.py /srv/app
  29. COPY nginx.conf /etc/nginx/http.d/default.conf
  30. EXPOSE 80
  31. COPY entrypoint.sh /
  32. RUN chmod u+x /entrypoint.sh
  33. ENTRYPOINT ["/entrypoint.sh"]