Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM alpine:3.7
- ENV PACKAGES="\
- dumb-init \
- musl \
- libc6-compat \
- linux-headers \
- build-base \
- bash \
- git \
- ca-certificates \
- freetype \
- libgfortran \
- libgcc \
- libstdc++ \
- openblas \
- tcl \
- tk \
- libssl1.0 \
- "
- ENV PYTHON_PACKAGES="\
- numpy \
- matplotlib \
- scipy \
- scikit-learn \
- nltk \
- "
- RUN apk add --no-cache --virtual build-dependencies python3 \
- && apk add --virtual build-runtime build-base python3-dev openblas-dev freetype-dev pkgconfig gfortran \
- && ln -s /usr/include/locale.h /usr/include/xlocale.h \
- && python3 -m ensurepip \
- && rm -r /usr/lib/python*/ensurepip \
- && pip3 install --upgrade pip setuptools \
- && ln -sf /usr/bin/python3 /usr/bin/python \
- && ln -sf pip3 /usr/bin/pip \
- && rm -r /root/.cache \
- && pip install --no-cache-dir $PYTHON_PACKAGES \
- && pip3 install 'pandas<0.21.0' \
- && apk add --no-cache --virtual build-dependencies $PACKAGES \
- && rm -rf /var/cache/apk/*
- COPY requirements.txt /requirements.txt
- RUN apk add --no-cache postgresql-dev libffi-dev libressl-dev libxml2 libxml2-dev libxslt libxslt-dev libjpeg-turbo-dev zlib-dev
- RUN pip3 install -r /requirements.txt
- # set working directory
- WORKDIR /usr/src/app
- RUN apk del build-runtime && \
- find -type d -name __pycache__ -prune -exec rm -rf {} \; && \
- rm -rf ~/.cache/pip
- # add entrypoint.sh
- COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
- RUN chmod +x /usr/src/app/entrypoint.sh
- # add app
- COPY . /usr/src/app
- # run server
- CMD ["/usr/src/app/entrypoint.sh"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement