Commit 688244b5563a3ee776c8acad7bf713395b5b362e

Authored by Wesnydy Ribeiro
1 parent 6d803010

Dockerfile for create container

Showing 1 changed file with 44 additions and 29 deletions   Show diff stats
Dockerfile
1 1 FROM ubuntu
2 2 MAINTAINER Jonathan Brilhante
3 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 15 #RUN apt-get install default-jdk -y
  16 +
  17 +#Install Nodejs
13 18 RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
14 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 23 RUN easy_install pip
  24 +
  25 +#Install express.js
17 26 RUN npm install -g express-generator
  27 +
  28 +#Install RabbitMQ
18 29 RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
19 30 RUN wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
20 31 RUN apt-get update
21 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 36 RUN pip install pika
  37 +
  38 +#Enable RabbitMQ plugins
  39 +RUN rabbitmq-plugins enable rabbitmq_management
  40 +
  41 +#Install Graylog
24 42 RUN pip install graypy
25 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 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 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 59 COPY ./vlibras-translate/ /root/vlibras-translate/
38 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 63 ENV HUNPOS_TAGGER="/root/vlibras-libs/aelius/bin/hunpos-tag"
45 64 ENV AELIUS_DATA="/root/vlibras-libs/aelius/aelius_data"
46 65 ENV TRANSLATE_DATA="/root/vlibras-translate/data"
47 66 ENV NLTK_DATA="/root/vlibras-libs/aelius/nltk_data"
48 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 70 EXPOSE 80:80
54   -WORKDIR /root/vlibras-tradutor/
  71 +WORKDIR /root/translate-api/
55 72 RUN npm i
56 73  
57 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
... ...