FROM python:3.8.6-slim
MAINTAINER DigiLocker
LABEL version="1.0"
ENV TZ="Asia/Kolkata"

WORKDIR /opt

COPY requirements.txt ./
COPY Dockerfile_simran.py

RUN apt -y update && apt -y upgrade
RUN apt-get install nfs-common -y
RUN apt install -y supervisor
#RUN apt install -y net-tools procps ca-certificates curl software-properties-common vim telnet
#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-get install -y getenvoy-envoy


#RUN apt-get install -y cron 
RUN apt-get install -y vim
RUN apt-get install -y supervisor
#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

COPY dockerconfig/supervisord.conf /etc/supervisord.conf

COPY dockerconfig/crontab_entries /etc/cron.d/crontab_entries
RUN chmod 0644 /etc/cron.d/crontab_entries
RUN service cron start

CMD ["/usr/bin/supervisord", "-n"]