Don't get KYC'ed
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.

32 lines
829 B

FROM python:3-alpine AS base
# Image to Build Dependencies
FROM base AS builder
COPY ./requirements.txt /app
# Build Dependencies
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk --no-cache add musl-dev libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev make g++ \
&& apk add jpeg-dev zlib-dev libjpeg \
&& pip install Pillow \
&& apk del build-deps
# Python Dependencies
RUN pip install --no-cache-dir --prefix=/install gunicorn
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# Runtime Environment Image
FROM base
# Runtime Dependencies
RUN apk --no-cache add libxml2 libxslt
COPY --from=builder /install /usr/local
COPY . /app/
CMD gunicorn kycnot:app --bind --worker-class sanic.worker.GunicornWorker