# Python Eve DigiLocker Accounts Services
# Build by; Saurabh Kumar Pandey@08122020

FROM python:3.8.6-slim
#FROM accounts/rabbit-mq-worker:base
MAINTAINER DigiLocker
LABEL version="1.0"
ENV TZ="Asia/Kolkata"

WORKDIR /opt

COPY requirements.txt ./

RUN apt update
RUN apt install -y net-tools procps apt-transport-https ca-certificates curl gnupg2 software-properties-common vim telnet
RUN apt install debian-keyring debian-archive-keyring apt-transport-https curl lsb-release -y
RUN curl -sL 'https://deb.dl.getenvoy.io/public/gpg.8115BA8E629CC074.key' |  gpg --dearmor -o /usr/share/keyrings/getenvoy-keyring.gpg
RUN echo a077cb587a1b622e03aa4bf2f3689de14658a9497a9af2c427bba5f4cc3c4723 /usr/share/keyrings/getenvoy-keyring.gpg | sha256sum --check
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/getenvoy-keyring.gpg] https://deb.dl.getenvoy.io/public/deb/debian $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/getenvoy.list
RUN apt-get update 
RUN apt install -y getenvoy-envoy   

#RUN apt-get update -y 
RUN apt-get install -y cron 
RUN apt-get install -y vim
RUN apt-get install -y supervisor
RUN apt-get install -y procps
RUN apt-get install -y gcc
RUN apt-get install -y libssl-dev libcurl4-openssl-dev python3-dev
RUN apt-get install -y net-tools
RUN rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip && pip uninstall pycurl && pip install --no-cache-dir -r requirements.txt
CMD ["/usr/bin/supervisord", "-n"] 