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

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

#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

#RUN apt-get install default-jdk -y
#RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E  bash -

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

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

#RUN npm install -g express-generator
#RUN cd $(npm root -g)/npm && npm install fs-extra && sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js

#Install python and python lib for RabbitMQ
RUN apt-get install -y python
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
RUN apt-get install -y python-yaml libgomp1 python-numpy python-pyfits python-matplotlib idle
RUN pip install nltk==3.0.5 nltk_tgrep --upgrade
RUN pip install pysrt pyvirtualdisplay
RUN apt-get install -y software-properties-common

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

WORKDIR /
RUN mkdir /storage/
RUN mkdir -p /storage/videos/

#Copy workers to container
WORKDIR /root/
ADD ./core/extractor.py /root/extractor.py
ADD ./core/mixer.py /root/mixer.py
ADD ./core/renderer.py /root/renderer.py
ADD ./core/translator.py /root/translator.py
ADD ./core/PikaManager.py /root/PikaManager.py
ADD ./core/processManager.py /root/processManager.py
ADD ./log/ /root/log/
ADD ./unityVideo/ /root/unityVideo/
ADD ./vlibras-translate/ /root/vlibras-translate/
ADD ./vlibras-libs/ /root/vlibras-libs/
ADD ./vlibras-api/ /root/vlibras-api/

#Workers environment variables
ENV VLIBRAS_VIDEO_CREATOR="/root/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="/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"

#ENV NODE_PATH=/root/vlibras-api/node_modules/;%NODE_PATH%

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

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 /root/vlibras-api/server.js & sleep 10) ; python /root/processManager.py