FROM centos:centos7

WORKDIR /var/app

# Update and install common packages
RUN yum -y update
RUN yum -y install epel-release curl git tar zip glibc-common

# Add Supervisord
RUN yum -y install supervisor

# Install python 3.6
RUN yum -y install gcc python36 python36-libs python36-devel python36-pip libffi-devel libffi

ADD . /var/app

# Explicitly set locale and related env vars to use not default POSIX, but en_US.UTF-8
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8

COPY ./requirements.txt .
RUN pip3.6 install --upgrade pip
RUN pip3.6 install -r requirements.txt --use-deprecated=legacy-resolver

# Add tmp workspace
RUN mkdir /tmp/feed_workspace
RUN chmod 755 /tmp/feed_workspace

# Run supervisord
ENTRYPOINT ["/usr/bin/supervisord", "-c", "conf/supervisor.conf"]
EXPOSE 9001
