# SPDX-License-Identifier: MulanPSL-2.0+
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.

FROM python:3.9.9

ENV PIP_SOURCE https://mirrors.huaweicloud.com/repository/pypi/simple/

ENV DEBIAN_FRONTEND noninteractive

RUN groupadd -g 1999 committer && useradd -m -u 1090 -g 1999 lkp

COPY cbs /opt/cbs
COPY lkp-tests /c/lkp-tests
COPY conf/sources.list /etc/apt/

WORKDIR /opt/cbs/src/trigger

COPY requirements.txt .

RUN umask 002 && pip3 install -r ./requirements.txt -i ${PIP_SOURCE}

RUN apt-get update && \
    apt-get install -y ruby ruby-dev

RUN gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/

RUN umask 002 && \
    gem install rest-client bunny json activesupport:6.1.4.4 md5sum base64

EXPOSE 20034

ENTRYPOINT gunicorn --config ./conf/gunicorn_conf.py run:app


