Dockerfile 2.88 KB
FROM ubuntu:14.04
MAINTAINER Jonathan Brilhante

#Dependencies installation - RabbitMQ / Graylog / Nodejs / Redis / MongoDB / FFmpeg

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

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

#Install Nodejs
RUN curl -sL https://deb.nodesource.com/setup | sudo bash -
RUN apt-get install -y nodejs && apt-get clean

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

#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 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

RUN groupadd -r vlibras && useradd -r -g vlibras vlibras

WORKDIR /
RUN mkdir /storage/
RUN mkdir -p /storage/videos/
RUN chown -R vlibras /storage/

USER vlibras
#Copy workers to container

WORKDIR /home/vlibras/

ADD ./core/extractor.py /home/vlibras/extractor.py
ADD ./core/mixer.py /home/vlibras/mixer.py
ADD ./core/renderer.py /home/vlibras/renderer.py
ADD ./core/translator.py /home/vlibras/translator.py
ADD ./core/PikaManager.py /home/vlibras/PikaManager.py
ADD ./core/processManager.py /home/vlibras/processManager.py
ADD ./log/ /home/vlibras/log/
ADD ./unityVideo/ /home/vlibras/unityVideo/
ADD ./vlibras-translate/ /home/vlibras/vlibras-translate/
ADD ./vlibras-libs/ /home/vlibras/vlibras-libs/
ADD ./vlibras-api/ /home/vlibras/vlibras-api/

#Workers environment variables
ENV VLIBRAS_VIDEO_CREATOR="/home/vlibras/unityVideo/videoCreator.x86_64"
ENV VLIBRAS_VIDEO_LIBRAS="/storage/libras"
ENV VLIBRAS_VIDEO_MIXED="/storage/videos"
ENV VLIBRAS_VIDEO_SCREENS="/storage/frames"

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

#Portas de comunicacao do container
WORKDIR /home/vlibras/vlibras-api/

USER root
RUN npm cache clean
RUN rm -rf node_modules
RUN npm i
RUN npm install amqplib
RUN npm --version
RUN node --version

#Comando de entrada quando inicializado
ENTRYPOINT (sleep 1m) ; (node /home/vlibras/vlibras-api/server.js & sleep 10) ; python /home/vlibras/processManager.py