FROM ccr.ccs.tencentyun.com/gm-base/py3.8:v1.0

COPY ./requirements.txt /tmp

WORKDIR /srv/apps/backend_auto/

RUN apk add --no-cache --virtual .build-deps  \
    bzip2-dev \
    coreutils \
    dpkg-dev dpkg \
    expat-dev \
    findutils \
    gcc \
    gdbm-dev \
    libc-dev \
    libffi-dev \
    libnsl-dev \
    libressl-dev \
    libtirpc-dev \
    linux-headers \
    make \
    ncurses-dev \
    pax-utils \
    readline-dev \
    sqlite-dev \
    tcl-dev \
    tk \
    tk-dev \
    xz-dev \
    zlib-dev \
    # 业务相关依赖和安装工具
    linux-headers \
    python-dev \
    # librdkafka-dev=0.11.6-r1 \
    mariadb-client \
    mariadb-dev \
    git \
    openssh \
    \
    # 取消ssh第一次链接的确认
    && echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config \
    # && pip install six verlib \
    && pip install --no-cache-dir -r /tmp/requirements.txt


COPY . /srv/apps/backend_auto/

# 先这样  最好用环境变量 如果配置变多后 再挂载
RUN  apk add curl && apk del .build-deps && echo "develop_host:" > host.yaml && echo "  url: http://backend-service" >> host.yaml

# 代码里有写死的 backend_auto
WORKDIR /srv/apps/backend_auto/

CMD python run.py