Skip to content

Instantly share code, notes, and snippets.

@haizaar

haizaar/Dockerfile

Created Jan 18, 2019
Embed
What would you like to do?
Crossbar Dockerfile alphine
FROM python:3.7.2-alpine AS builder
RUN apk add --no-cache --virtual .build-deps \
build-base \
libffi-dev \
openssl-dev \
linux-headers
ENV PYROOT /pyroot
ENV PATH $PYROOT/bin:$PATH
ENV PYTHONUSERBASE $PYROOT
RUN pip install --user crossbar
FROM haizaar/python-minimal:3.7.2-alpine3.8-2 AS prod
RUN apk add --no-cache openssl libffi
ENV PYROOT /pyroot
ENV PATH $PYROOT/bin:$PATH
ENV PYTHONPATH $PYROOT/lib/python:$PATH
# This is crucial for pkg_resources to work
ENV PYTHONUSERBASE $PYROOT
# Finally, copy artifacts
COPY --from=builder $PYROOT/lib/ $PYROOT/lib/
COPY --from=builder $PYROOT/bin/ $PYROOT/bin/
ENTRYPOINT ["crossbar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment