Commit 688244b5563a3ee776c8acad7bf713395b5b362e
1 parent
6d803010
Exists in
master
and in
4 other branches
Dockerfile for create container
Showing
1 changed file
with
44 additions
and
29 deletions
Show diff stats
Dockerfile
1 | FROM ubuntu | 1 | FROM ubuntu |
2 | MAINTAINER Jonathan Brilhante | 2 | MAINTAINER Jonathan Brilhante |
3 | #USER root | 3 | #USER root |
4 | -#Instalacao dependencias - NPM / Python / RabbitMQ e Plugins | ||
5 | -RUN apt-get update | ||
6 | -RUN apt-get upgrade -y | ||
7 | -RUN apt-get update | ||
8 | -RUN apt-get install -y build-essential | ||
9 | -RUN apt-get install sudo -y | ||
10 | -RUN apt-get install curl -y | ||
11 | -RUN apt-get install wget -y | 4 | + |
5 | +#Dependencies installation - RabbitMQ / Graylog / Nodejs | ||
6 | + | ||
7 | +#Packages updates | ||
8 | +RUN apt-get -y update | ||
9 | +RUN apt-get -y upgrade | ||
10 | +RUN apt-get -y update | ||
11 | + | ||
12 | +#Install necessary packages | ||
13 | +RUN apt-get install -y build-essential libssl-dev sudo curl wget | ||
14 | + | ||
12 | #RUN apt-get install default-jdk -y | 15 | #RUN apt-get install default-jdk -y |
16 | + | ||
17 | +#Install Nodejs | ||
13 | RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | 18 | RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - |
14 | RUN apt-get install -y nodejs | 19 | RUN apt-get install -y nodejs |
15 | -RUN apt-get install python-setuptools -y | 20 | + |
21 | +#Install python packages | ||
22 | +RUN apt-get install -y python-setuptools | ||
16 | RUN easy_install pip | 23 | RUN easy_install pip |
24 | + | ||
25 | +#Install express.js | ||
17 | RUN npm install -g express-generator | 26 | RUN npm install -g express-generator |
27 | + | ||
28 | +#Install RabbitMQ | ||
18 | RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list | 29 | RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list |
19 | RUN wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add - | 30 | RUN wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add - |
20 | RUN apt-get update | 31 | RUN apt-get update |
21 | RUN apt-get install rabbitmq-server -y | 32 | RUN apt-get install rabbitmq-server -y |
22 | -RUN apt-get install python -y | 33 | + |
34 | +#Install python and python lib for RabbitMQ | ||
35 | +RUN apt-get install -y python | ||
23 | RUN pip install pika | 36 | RUN pip install pika |
37 | + | ||
38 | +#Enable RabbitMQ plugins | ||
39 | +RUN rabbitmq-plugins enable rabbitmq_management | ||
40 | + | ||
41 | +#Install Graylog | ||
24 | RUN pip install graypy | 42 | RUN pip install graypy |
25 | RUN pip install graypy[amqp] | 43 | RUN pip install graypy[amqp] |
26 | -RUN rabbitmq-plugins enable rabbitmq_management | ||
27 | -RUN apt-get install pkg-config -y | ||
28 | -RUN apt-get install libfreetype6-dev libpng-dev -y | ||
29 | -RUN apt-get install python-yaml -y | ||
30 | -RUN apt-get install libgomp1 python-numpy python-pyfits python-matplotlib idle -y | 44 | + |
45 | +#Install aditional packages | ||
46 | +RUN apt-get install -y pkg-config libfreetype6-dev libpng-dev | ||
47 | +RUN apt-get install -y python-yaml libgomp1 python-numpy python-pyfits python-matplotlib idle | ||
31 | RUN pip install nltk==3.0.5 nltk_tgrep --upgrade | 48 | RUN pip install nltk==3.0.5 nltk_tgrep --upgrade |
32 | 49 | ||
33 | -#Copia do Servidor e Workers para o container | 50 | +#Copy workers to container |
34 | WORKDIR /root/ | 51 | WORKDIR /root/ |
35 | -COPY ./vlibras-tradutor/ /root/vlibras-tradutor/ | ||
36 | -#CMD chmod -R 777 /root/ | 52 | +COPY ./core/translator.py /root/translator.py |
53 | +COPY ./core/PikaManager.py /root/PikaManager.py | ||
54 | +COPY ./core/processManager.py /root/processManager.py | ||
55 | +COPY ./core/logger.py /root/logger.py | ||
56 | + | ||
57 | +COPY ./translate-api/ /root/translate-api/ | ||
58 | + | ||
37 | COPY ./vlibras-translate/ /root/vlibras-translate/ | 59 | COPY ./vlibras-translate/ /root/vlibras-translate/ |
38 | COPY ./vlibras-libs/ /root/vlibras-libs/ | 60 | COPY ./vlibras-libs/ /root/vlibras-libs/ |
39 | 61 | ||
40 | -#Instalando Tradutor | ||
41 | -#WORKDIR /root/vlibras-translate/ | ||
42 | -#RUN . /root/vlibras-translate/scripts/linux/install.sh | ||
43 | - | 62 | +#Translator environment variables |
44 | ENV HUNPOS_TAGGER="/root/vlibras-libs/aelius/bin/hunpos-tag" | 63 | ENV HUNPOS_TAGGER="/root/vlibras-libs/aelius/bin/hunpos-tag" |
45 | ENV AELIUS_DATA="/root/vlibras-libs/aelius/aelius_data" | 64 | ENV AELIUS_DATA="/root/vlibras-libs/aelius/aelius_data" |
46 | ENV TRANSLATE_DATA="/root/vlibras-translate/data" | 65 | ENV TRANSLATE_DATA="/root/vlibras-translate/data" |
47 | ENV NLTK_DATA="/root/vlibras-libs/aelius/nltk_data" | 66 | ENV NLTK_DATA="/root/vlibras-libs/aelius/nltk_data" |
48 | ENV PYTHONPATH=":/root/vlibras-libs/aelius:/root/vlibras-translate/src::/root/vlibras-libs/aelius:/root/vlibras-translate/src" | 67 | ENV PYTHONPATH=":/root/vlibras-libs/aelius:/root/vlibras-translate/src::/root/vlibras-libs/aelius:/root/vlibras-translate/src" |
49 | 68 | ||
50 | - | ||
51 | -#Portas de comunicacao do container | ||
52 | -#EXPOSE 12201 | 69 | +#Portas de comunicacao do container |
53 | EXPOSE 80:80 | 70 | EXPOSE 80:80 |
54 | -WORKDIR /root/vlibras-tradutor/ | 71 | +WORKDIR /root/translate-api/ |
55 | RUN npm i | 72 | RUN npm i |
56 | 73 | ||
57 | #Comando de entrada quando inicializado | 74 | #Comando de entrada quando inicializado |
58 | -ENTRYPOINT python worker.py & python worker.py & python worker.py & rabbitmq-server start & python logger.py 150.165.205.14 & npm start | ||
59 | - | ||
60 | -#ENTRYPOINT /bin/bash -c "source ~/.bash_profile & python worker.py" & rabbitmq-server start & python logger.py 150.165.205.14 & npm start | 75 | +ENTRYPOINT (rabbitmq-server start & sleep 1m) ; npm start & python /root/translator.py |