123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- FROM python:3-alpine AS base
- LABEL MAINTAINER="heckyel@riseup.net"
- # Image to Build Dependencies
- FROM base AS builder
- ENV LANG C.UTF-8
- ENV LC_ALL C.UTF-8
- RUN apk add --no-cache musl-dev build-base make gcc g++ \
- libxml2-dev libffi-dev zlib-dev libjpeg lcms2-dev libimagequant-dev \
- libjpeg-turbo-dev libwebp-dev openjpeg-dev tk-dev py3-pillow libpq-dev
- ARG APP_DIR="/srv/app"
- RUN mkdir --parents "$APP_DIR"
- WORKDIR "$APP_DIR"
- COPY requirements_prod.txt .
- RUN pip install --no-cache-dir --prefix=/install wheel gunicorn
- RUN pip install --no-cache-dir --prefix=/install -r requirements_prod.txt
- # Runtime Environment Image
- FROM base
- WORKDIR /srv/app
- # Runtime Dependencies
- RUN apk add py3-olefile brotli-libs libpng freetype libxcb \
- libimagequant libjpeg-turbo lcms2 openjpeg libwebp zstd-libs \
- tiff libxau libmd libbsd libxdmcp libpq sassc nginx
- COPY --from=builder /install /usr/local
- COPY core/ /srv/app/core
- COPY personalsite/ /srv/app/personalsite
- COPY project/ /srv/app/project
- COPY social/ /srv/app/social
- COPY manage.py /srv/app
- COPY nginx.conf /etc/nginx/http.d/default.conf
- EXPOSE 80
- COPY entrypoint.sh /
- RUN chmod u+x /entrypoint.sh
- ENTRYPOINT ["/entrypoint.sh"]
|