FROM arm32v6/alpine:3.9.6

WORKDIR /usr/src/app
COPY ./requirements.txt /usr/src/app/requirements.txt

RUN apk --no-cache add \
        python3 \
        libstdc++ \
        lapack \
        git \
        libxml2 \
        libxslt \
        libffi \
        && \
    pip3 install --no-cache-dir --upgrade pip setuptools && \
    apk add --no-cache --virtual .build-deps \
        build-base \
        python3-dev \
        lapack-dev \
        gfortran \
        libxml2-dev \
        libxslt-dev \
        libffi-dev \
         && \
    ln -s /usr/include/locale.h /usr/include/xlocale.h && \
    pip3 install --no-cache-dir -r requirements.txt && \
    rm -fr /root/.cache && \
    rm /usr/include/xlocale.h && \
    apk del .build-deps

COPY . .
ENV PYTHONPATH `pwd`/..

CMD [ "python3", "data_fetcher" ]
