Add docker support
This commit is contained in:
47
django/Dockerfile
Normal file
47
django/Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
|
||||
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 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"]
|
||||
Reference in New Issue
Block a user