dockerfiles/niko-niko/Dockerfile

24 lines
781 B
Docker

FROM alpine:3.7 as builder
RUN mkdir -p /var/cache/apk /niko-niko && ln -s /var/cache/apk /etc/apk/cache && apk add \
--update gcc musl-dev py2-pip python-dev git
RUN git clone https://github.com/glebb/feelings /niko-niko
RUN pip install wheel && pip wheel --wheel-dir=/root/wheel -r /niko-niko/requirements.txt
FROM alpine:3.7 as production
COPY --from=builder /root/wheel /root/wheel
COPY --from=builder /root/.cache /root/.cache
COPY --from=builder /etc/apk/cache /etc/apk/cache
COPY --from=builder /niko-niko/ /niko-niko
RUN apk add --update py2-pip python && pip install --no-index \
--find-links=/root/wheel -r /niko-niko/requirements.txt
RUN rm -rf /root/.cache /etc/apk/cache/* /root/wheel/
WORKDIR /niko-niko
CMD ["python", "tornado_server.py"]
EXPOSE 8080