Dockerfile
2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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