FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive
ENV USER root

RUN apt-get update && \
    apt-get install -y  build-essential && \
    apt-get install -y emacs sshpass supervisor && \
    apt-get install -y openssh-server nano

#
# Install python libs  For our python server
#
RUN apt-get install -y software-properties-common
#RUN add-apt-repository ppa:fkrull/deadsnakes
RUN apt-get update
RUN apt-get install -y python2.7
RUN apt-get install -y --reinstall python-pkg-resources
RUN apt-get install -y python-pip python-dev build-essential
#RUN apt-get install -y wkhtmltopdf

#RUN apt install -y python-dns
RUN pip install --upgrade pip
#RUN pip install show
#RUN pip install unidecode
#RUN pip install mysql-connector-python
#RUN pip install python_http_client
#RUN pip install sendgrid
#RUN pip install pycrypto
#RUN pip install python-dateutil
RUN pip install requests
#RUN pip install image
#RUN pip install influxdb
#RUN pip install geopy
#RUN pip install twilio
#RUN pip install simplejson
#RUN pip install google-api-python-client
#RUN pip install pdfkit
#RUN pip install phonenumbers
RUN pip install flask_restful
RUN pip install flask
RUN pip install flask-cors
#
# Locales for emails
#
RUN apt-get update
RUN apt-get -y install locales
RUN locale-gen en_US.UTF-8
RUN locale-gen en_CA.UTF-8
RUN locale-gen fr_CA.UTF-8
RUN locale-gen fr_FR.UTF-8
RUN apt-get update
RUN apt-get install locales

#
# SSH
#
#RUN mkdir /var/run/sshd
#RUN echo 'root:obt2014' | chpasswd
#RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
#RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd


#COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf


#EXPOSE 22
#EXPOSE 8085
EXPOSE 5000
#CMD ["/usr/bin/supervisord"]
COPY . .
CMD ["python","igloo_flask.py"]
