Dockerfile 2.8 KB
FROM ubuntu:14.04
MAINTAINER Jonathan Brilhante
#USER root

#Dependencies installation - RabbitMQ / Graylog / Nodejs

#Packages updates
RUN apt-get -y upgrade
RUN apt-get -y update

#Install necessary packages
RUN apt-get install -y build-essential libssl-dev sudo curl wget && apt-get clean

#Install python packages
RUN apt-get install -y python-setuptools && easy_install pip

#Install RabbitMQ
RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list && wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
RUN apt-get update && apt-get install rabbitmq-server -y && apt-get clean

#Install python and python lib for RabbitMQ
RUN apt-get install -y python && pip install pika

#Enable RabbitMQ plugins
RUN rabbitmq-plugins enable rabbitmq_management

#Install Graylog
RUN pip install graypy
RUN pip install graypy[amqp]

#Install aditional packages
RUN apt-get install -y pkg-config libfreetype6-dev libpng-dev xvfb python-yaml libgomp1 python-numpy python-pyfits python-matplotlib idle && apt-get clean
RUN pip install nltk==3.0.5 nltk_tgrep --upgrade
RUN pip install pysrt ffmpy pyvirtualdisplay
RUN apt-get install -y software-properties-common && apt-get clean

#Install FFmpeg
RUN add-apt-repository ppa:mc3man/trusty-media &&  apt-get -y update && apt-get install -y ffmpeg gstreamer0.10-ffmpeg && apt-get clean

WORKDIR /root/
RUN mkdir -p ./storage/
RUN mkdir -p ./storage/libras
RUN mkdir -p ./storage/frames

#Copy workers to container
ADD ./translator.py /root/translator.py
ADD ./renderer.py /root/renderer.py
ADD ./indexer.py /root/indexer.py
ADD ./PikaManager.py /root/PikaManager.py
ADD ./processManager.py /root/processManager.py
ADD ./logger.py /root/logger.py
ADD ./Trie.py /root/Trie.py

ADD ./fonts/ /root/fonts/
ADD ./bundles/ /root/storage/bundles/
ADD ./vlibras-translate/ /root/vlibras-translate/
ADD ./vlibras-libs/ /root/vlibras-libs/
ADD ./unityVideo/ /root/unityVideo/

RUN chmod +x /root/unityVideo/videoCreator.x86_64

#Workers environment variables
ENV VLIBRAS_VIDEO_CREATOR="/root/unityVideo/videoCreator.x86_64"
ENV VLIBRAS_VIDEO_LIBRAS="/root/storage/libras"
ENV VLIBRAS_VIDEO_SCREENS="/root/storage/frames"
ENV SIGNS_VLIBRAS="/root/storage/bundles"
ENV TEXT_FONTS="/root/fonts/FreeSans.ttf"

#Translator environment variables
ENV HUNPOS_TAGGER="/root/vlibras-libs/aelius/bin/hunpos-tag"
ENV AELIUS_DATA="/root/vlibras-libs/aelius/aelius_data"
ENV TRANSLATE_DATA="/root/vlibras-translate/data"
ENV NLTK_DATA="/root/vlibras-libs/aelius/nltk_data"
ENV PYTHONPATH=":/root/vlibras-libs/aelius:/root/vlibras-translate/src:/root/vlibras-libs/aelius:/root/vlibras-translate/src"

#Comando de entrada quando inicializado
ENTRYPOINT sleep 1m ; python /root/processManager.py