Skip to content

Instantly share code, notes, and snippets.

@haizaar
Created January 18, 2019 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haizaar/7f10473bdeaaab0508f74f4eaae26f71 to your computer and use it in GitHub Desktop.
Save haizaar/7f10473bdeaaab0508f74f4eaae26f71 to your computer and use it in GitHub Desktop.
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