Dockerfile
3.9 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
FROM ubuntu:14.04
MAINTAINER Jonathan Brilhante
#USER root
#Dependencies installation - RabbitMQ / Graylog / Nodejs / Redis / MongoDB / FFmpeg
#Packages updates
RUN apt-get -y update
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
#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 RabbitMQ
RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
RUN wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
RUN apt-get -y update
RUN apt-get install -y rabbitmq-server
#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]
#Enable RabbitMQ plugins
RUN rabbitmq-plugins enable rabbitmq_management
#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
#Install Redis
RUN apt-get install -y redis-server
RUN service redis-server restart
#Install MongoDB
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
RUN apt-get -y update && apt-get install -y mongodb-org
RUN mkdir -p /data/db
WORKDIR /
RUN mkdir /storage/
#Copy workers to container
WORKDIR /root/
COPY ./core/extractor.py /root/extractor.py
COPY ./core/mixer.py /root/mixer.py
COPY ./core/renderer.py /root/renderer.py
COPY ./core/translator.py /root/translator.py
COPY ./core/PikaManager.py /root/PikaManager.py
COPY ./core/processManager.py /root/processManager.py
COPY ./log/ /root/log/
COPY ./unityVideo/ /root/unityVideo/
COPY ./vlibras-translate/ /root/vlibras-translate/
COPY ./vlibras-libs/ /root/vlibras-libs/
COPY ./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/
VOLUME ["/storage/"]
RUN npm cache clean
RUN rm -rf node_modules
RUN npm i
COPY ./vlibras-api/node_modules/amqplib/ /root/vlibras-api/node_modules/amqplib/
RUN npm --version
RUN node --version
RUN /usr/bin/mongod &
#Comando de entrada quando inicializado
ENTRYPOINT (/usr/bin/mongod & redis-server & rabbitmq-server start & sleep 3m) ; (node /root/vlibras-api/server.js & sleep 10) ; python /root/processManager.py