FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive

RUN echo "Install Python v3.8:" \
    && apt-get update \
    && apt-get install -y  \
        python3-dev \
        python3-pip \
        python3-setuptools \
        python3-wheel \
    && pip3 config set global.index-url https://mirror.baidu.com/pypi/simple \
    && pip3 config set global.extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple \
    && pip3 install --upgrade --quiet pip setuptools \
    && python3 --version

# --- install requirements ---
RUN echo "Install Python Requirements:" \
    && pip3 install --default-timeout=1800 --no-cache-dir \
        # --- for base --- \
        cython==3.0.0a9 \
        pyinstaller==4.10 \
        # --- for libraries --- \
        pycrypto==2.6.1 \
        paramiko==2.7.2 \
        apscheduler==3.7.0 \
        # --- for client --- \
        requests==2.25.1 \
        redis==3.5.3 \
        pymongo==3.11.2 \
        influxdb==5.3.1 \
        pymysql==0.9.3 \
        peewee==3.17.0 \
        SQLAlchemy==1.4.30 \
        paho-mqtt==1.6.1 \
        # --- for server --- \
        typesystem==0.2.5 \
        aiohttp==3.7.3 \
        responder==2.0.7 \
        uvloop==0.14.0 \
        uvicorn==0.13.2 \
        supervisor==4.2.1 \
        websocket-client==0.58.0 \
    && echo "End."

RUN echo "Debug Tools:" \
    && apt-get update \
    && apt-get install -y inetutils-ping iproute2 net-tools wget unzip git bash