Commit de0b47bccbf9eaec1211b60455621bc57fddb10f

Authored by João Vitor Rebouças
1 parent 246e996a
Exists in master

Adicionando composes e Dockerfiles

external-lb-docker.yml 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +version: '2'
  2 +services:
  3 + lb-vlibras:
  4 + image: rancher/lb-service-haproxy:v0.6.2
  5 + ports:
  6 + - 80:80/tcp
  7 + - 8080:8080/tcp
  8 + labels:
  9 + io.rancher.container.agent.role: environmentAdmin
  10 + io.rancher.container.create_agent: 'true'
  11 + io.rancher.scheduler.global: 'true'
... ...
external-lb-rancher.yml 0 → 100644
... ... @@ -0,0 +1,41 @@
  1 +version: '2'
  2 +services:
  3 + lb-vlibras:
  4 + start_on_create: true
  5 + lb_config:
  6 + certs: []
  7 + port_rules:
  8 + - path: /translate
  9 + priority: 1
  10 + protocol: http
  11 + service: tradutor/api
  12 + source_port: 80
  13 + target_port: 8080
  14 + - path: /video
  15 + priority: 2
  16 + protocol: http
  17 + service: tradutor/api
  18 + source_port: 80
  19 + target_port: 8080
  20 + - priority: 3
  21 + protocol: http
  22 + service: video/video
  23 + source_port: 8080
  24 + target_port: 8080
  25 + - priority: 4
  26 + protocol: http
  27 + service: portal/web
  28 + source_port: 80
  29 + target_port: 8080
  30 + stickiness_policy:
  31 + cookie: lb-vlibras
  32 + indirect: false
  33 + mode: insert
  34 + nocache: false
  35 + postonly: false
  36 + health_check:
  37 + healthy_threshold: 2
  38 + response_timeout: 2000
  39 + port: 42
  40 + unhealthy_threshold: 3
  41 + interval: 2000
... ...
portal-docker.yml 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +version: '2'
  2 +volumes:
  3 + portal_db:
  4 + external: true
  5 + driver: 'null'
  6 + portal_data:
  7 + external: true
  8 + driver: 'null'
  9 + portal_logs:
  10 + external: true
  11 + driver: 'null'
  12 +services:
  13 + web:
  14 + image: hub.docker.planejamento.gov.br/vlibras/portal:coppe
  15 + environment:
  16 + DOMAIN_NAME: b-vlibras-prd-01.brazilsouth.cloudapp.azure.com:80
  17 + VLIBRAS_API: b-vlibras-prd-01.brazilsouth.cloudapp.azure.com:8080
  18 + VLIBRAS_API_URL: http://b-vlibras-prd-01.brazilsouth.cloudapp.azure.com:8080/api/
  19 + DATABASE_HOST: db
  20 + DATABASE_USER: vlibrasuser
  21 + DATABASE_PASSWORD: d426ff41c6d096db6f033c89b17b403e
  22 + DATABASE_DB: vlibrasvideo
  23 + volumes:
  24 + - portal_data:/vlibraslportal/
  25 + - portal_logs:/myapp/log
  26 + links:
  27 + - redis:redis
  28 + - db:db
  29 + labels:
  30 + io.rancher.container.pull_image: always
  31 + redis:
  32 + image: hub.docker.planejamento.gov.br/capgov/redis:3.2.8
  33 + command:
  34 + - /etc/redis/redis.conf
  35 + db:
  36 + image: hub.docker.planejamento.gov.br/capgov/mysql:5.6
  37 + environment:
  38 + MYSQL_DATABASE: vlibrasvideo
  39 + MYSQL_PASSWORD: d426ff41c6d096db6f033c89b17b403e
  40 + MYSQL_ROOT_PASSWORD: iedeeb0ohj6eiphahSahroosh9jeiH
  41 + MYSQL_USER: vlibrasuser
  42 + volumes:
  43 + - portal_db:/var/lib/mysql
... ...
portal-rancher.yml 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +version: '2'
  2 +services:
  3 + web:
  4 + scale: 1
  5 + start_on_create: true
  6 + redis:
  7 + scale: 1
  8 + start_on_create: true
  9 + db:
  10 + scale: 1
  11 + start_on_create: true
... ...
portal/Dockerfile 0 → 100755
... ... @@ -0,0 +1,45 @@
  1 +FROM phusion/baseimage:0.9.8
  2 +MAINTAINER Jonathan Brilhante
  3 +MAINTAINER CAPGov-INFRA
  4 +
  5 +ENV LANG en_US.UTF-8
  6 +ENV LC_ALL en_US.UTF-8
  7 +ENV CONFIGURE_OPTS --disable-install-rdoc
  8 +ENV APP_HOME /myapp
  9 +ENV DEBIAN_FRONTEND=noninteractive
  10 +
  11 +# Install tools & libs to compile everything # Install imagemagick
  12 +RUN apt-get update && \
  13 + apt-get install -y build-essential libssl-dev libreadline-dev imagemagick libmagick++-dev libmagic-dev git-core mysql-client libmysqlclient-dev && \
  14 + apt-get clean && \
  15 + git clone https://github.com/sstephenson/ruby-build.git && \
  16 + cd ruby-build && \
  17 + ./install.sh && \
  18 + ruby-build 2.1.1 /usr/local && \
  19 + gem install bundler && \
  20 + gem install mysql2 && \
  21 + mkdir $APP_HOME && \
  22 + groupadd -r vlibras && \
  23 + useradd -r -g vlibras vlibras && \
  24 + apt-get purge -y build-essential git-core && \
  25 + apt-get clean
  26 +
  27 +WORKDIR $APP_HOME
  28 +
  29 +ADD * $APP_HOME/
  30 +RUN bundle install
  31 +
  32 +ADD . $APP_HOME
  33 +
  34 +COPY ./docker-entrypoint.sh /
  35 +
  36 +RUN chown -R vlibras. $APP_HOME && chmod +x /docker-entrypoint.sh
  37 +
  38 +USER vlibras
  39 +
  40 +EXPOSE 8080
  41 +
  42 +VOLUME ["/myapp/log"]
  43 +VOLUME ["/vlibraslportal"]
  44 +
  45 +ENTRYPOINT ["/docker-entrypoint.sh"]
... ...
tradutor-docker.yml 0 → 100644
... ... @@ -0,0 +1,33 @@
  1 +version: '2'
  2 +volumes:
  3 + tradutor_logs:
  4 + external: true
  5 + driver: 'null'
  6 + tradutor_bd:
  7 + external: true
  8 + driver: 'null'
  9 + core_db:
  10 + external: true
  11 + driver: 'null'
  12 + tradutor_rabbitmq:
  13 + external: true
  14 + driver: 'null'
  15 +services:
  16 + mongo:
  17 + image: hub.docker.planejamento.gov.br/capgov/mongodb
  18 + volumes:
  19 + - tradutor_bd:/data/db
  20 + rabbit:
  21 + image: hub.docker.planejamento.gov.br/capgov/rabbitmq:3.6.9-1-management
  22 + volumes:
  23 + - tradutor_rabbitmq:/var/lib/rabbitmq
  24 + api:
  25 + image: hub.docker.planejamento.gov.br/vlibras/tradutor:coppe
  26 + volumes:
  27 + - core_db:/home/vlibras/storage/
  28 + - tradutor_logs:/home/vlibras/translate-api/logs
  29 + links:
  30 + - mongo:mongo
  31 + - rabbit:rabbit
  32 + labels:
  33 + io.rancher.container.pull_image: always
... ...
tradutor-rancher.yml 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +version: '2'
  2 +services:
  3 + mongo:
  4 + scale: 1
  5 + start_on_create: true
  6 + rabbit:
  7 + scale: 1
  8 + start_on_create: true
  9 + api:
  10 + scale: 1
  11 + start_on_create: true
... ...
translate/Dockerfile 0 → 100755
... ... @@ -0,0 +1,64 @@
  1 +FROM ubuntu:14.04
  2 +MAINTAINER Jonathan Brilhante
  3 +MAINTAINER CAPGov-INFRA
  4 +
  5 +COPY ./core/translator.py /home/vlibras/translator.py
  6 +COPY ./core/renderer.py /home/vlibras/renderer.py
  7 +COPY ./core/indexer.py /home/vlibras/indexer.py
  8 +COPY ./core/PikaManager.py /home/vlibras/PikaManager.py
  9 +COPY ./core/processManager.py /home/vlibras/processManager.py
  10 +COPY ./core/logger.py /home/vlibras/logger.py
  11 +COPY ./core/Trie.py /home/vlibras/Trie.py
  12 +
  13 +COPY ./fonts/ /home/vlibras/fonts/
  14 +
  15 +COPY ./translate-api/ /home/vlibras/translate-api/
  16 +COPY ./bundles/ /home/vlibras/bundles/
  17 +
  18 +COPY ./vlibras-translate/ /home/vlibras/vlibras-translate/
  19 +COPY ./vlibras-libs/ /home/vlibras/vlibras-libs/
  20 +COPY ./unityVideo/ /home/vlibras/unityVideo/
  21 +
  22 +ENV VLIBRAS_VIDEO_CREATOR="/home/vlibras/unityVideo/videoCreator.x86_64"
  23 +ENV VLIBRAS_VIDEO_LIBRAS="/home/vlibras/storage/libras"
  24 +ENV VLIBRAS_VIDEO_SCREENS="/home/vlibras/storage/frames"
  25 +ENV SIGNS_VLIBRAS="/home/vlibras/bundles"
  26 +ENV TEXT_FONTS="/home/vlibras/fonts/FreeSans.ttf"
  27 +
  28 +#Translator environment variables
  29 +ENV HUNPOS_TAGGER="/home/vlibras/vlibras-libs/aelius/bin/hunpos-tag"
  30 +ENV AELIUS_DATA="/home/vlibras/vlibras-libs/aelius/aelius_data"
  31 +ENV TRANSLATE_DATA="/home/vlibras/vlibras-translate/data"
  32 +ENV NLTK_DATA="/home/vlibras/vlibras-libs/aelius/nltk_data"
  33 +ENV PYTHONPATH=":/home/vlibras/vlibras-libs/aelius:/home/vlibras/vlibras-translate/src:/home/vlibras/vlibras-libs/aelius:/home/vlibras/vlibras-translate/src"
  34 +
  35 +RUN apt-get update -y && \
  36 + apt-get install -y sudo curl wget software-properties-common && \
  37 + curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
  38 + add-apt-repository ppa:mc3man/trusty-media && \
  39 + apt-get -y update && \
  40 + apt-get install -y pkg-config libfreetype6-dev libpng-dev xvfb build-essential libssl-dev nodejs python-pip python-yaml libgomp1 python-numpy python-pyfits python-matplotlib idle ffmpeg gstreamer0.10-ffmpeg && \
  41 + pip install nltk==3.0.5 nltk_tgrep --upgrade && \
  42 + pip install pysrt ffmpy pyvirtualdisplay pika && \
  43 + groupadd -r vlibras && useradd -r -g vlibras vlibras && \
  44 + mkdir -p /home/vlibras/storage/libras
  45 +
  46 +WORKDIR /home/vlibras/translate-api/
  47 +
  48 +COPY ./docker-entrypoint.sh /
  49 +
  50 +RUN npm i && \
  51 + mkdir -p /home/vlibras/translate-api/logs && \
  52 + chown -R vlibras. /home/vlibras && \
  53 + chmod +x /docker-entrypoint.sh && \
  54 + mkdir -p /storage && \
  55 + chown -R vlibras. /storage
  56 +
  57 +USER vlibras
  58 +
  59 +VOLUME ["/home/vlibras/translate-api/logs"]
  60 +VOLUME ["/home/vlibras/storage"]
  61 +
  62 +EXPOSE 8080
  63 +
  64 +ENTRYPOINT ["/docker-entrypoint.sh"]
... ...
video-docker.yml 0 → 100644
... ... @@ -0,0 +1,36 @@
  1 +version: '2'
  2 +volumes:
  3 + videos_bd:
  4 + external: true
  5 + driver: 'null'
  6 + videos_rabbitmq:
  7 + external: true
  8 + driver: 'null'
  9 + core_storage:
  10 + external: true
  11 + driver: 'null'
  12 + video_logs:
  13 + external: true
  14 + driver: 'null'
  15 +services:
  16 + mongo:
  17 + image: hub.docker.planejamento.gov.br/capgov/mongodb
  18 + volumes:
  19 + - videos_bd:/data/db
  20 + rabbit:
  21 + image: hub.docker.planejamento.gov.br/capgov/rabbitmq:3.6.9-1-management
  22 + volumes:
  23 + - videos_rabbitmq:/var/lib/rabbitmq
  24 + video:
  25 + image: hub.docker.planejamento.gov.br/vlibras/video_container:coppe
  26 + environment:
  27 + VLIBRAS_VIDEO_IP: b-vlibras-prd-01.brazilsouth.cloudapp.azure.com
  28 + VLIBRAS_VIDEO_PORT: '8080'
  29 + volumes:
  30 + - core_storage:/storage/
  31 + - video_logs:/home/vlibras/vlibras-api/logsystem/logs
  32 + links:
  33 + - mongo:mongo
  34 + - rabbit:rabbit
  35 + labels:
  36 + io.rancher.container.pull_image: always
... ...
video-rancher.yml 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +version: '2'
  2 +services:
  3 + mongo:
  4 + scale: 1
  5 + start_on_create: true
  6 + rabbit:
  7 + scale: 1
  8 + start_on_create: true
  9 + video:
  10 + scale: 1
  11 + start_on_create: true
... ...
video/Dockerfile 0 → 100755
... ... @@ -0,0 +1,66 @@
  1 +FROM ubuntu:14.04
  2 +MAINTAINER Jonathan Brilhante
  3 +MAINTAINER CAPGov-INFRA
  4 +
  5 +#Workers environment variables
  6 +ENV VLIBRAS_VIDEO_CREATOR="/home/vlibras/unityVideo/videoCreator.x86_64"
  7 +ENV VLIBRAS_VIDEO_LIBRAS="/storage/libras"
  8 +ENV VLIBRAS_VIDEO_MIXED="/storage/videos"
  9 +ENV VLIBRAS_VIDEO_SCREENS="/storage/frames"
  10 +
  11 +#Translator environment variables
  12 +ENV HUNPOS_TAGGER="/home/vlibras/vlibras-libs/aelius/bin/hunpos-tag"
  13 +ENV AELIUS_DATA="/home/vlibras/vlibras-libs/aelius/aelius_data"
  14 +ENV TRANSLATE_DATA="/home/vlibras/vlibras-translate/data"
  15 +ENV NLTK_DATA="/home/vlibras/vlibras-libs/aelius/nltk_data"
  16 +ENV PYTHONPATH=":/home/vlibras/vlibras-libs/aelius:/home/vlibras/vlibras-translate/src"
  17 +
  18 +ENV DEBIAN_FRONTEND=noninteractive
  19 +
  20 +COPY ./core/extractor.py /home/vlibras/extractor.py
  21 +COPY ./core/mixer.py /home/vlibras/mixer.py
  22 +COPY ./core/renderer.py /home/vlibras/renderer.py
  23 +COPY ./core/translator.py /home/vlibras/translator.py
  24 +COPY ./core/PikaManager.py /home/vlibras/PikaManager.py
  25 +COPY ./core/processManager.py /home/vlibras/processManager.py
  26 +COPY ./log/ /home/vlibras/log/
  27 +COPY ./unityVideo/ /home/vlibras/unityVideo/
  28 +COPY ./vlibras-translate/ /home/vlibras/vlibras-translate/
  29 +COPY ./vlibras-libs/ /home/vlibras/vlibras-libs/
  30 +COPY ./vlibras-api/ /home/vlibras/vlibras-api/
  31 +
  32 +RUN apt-get -y update && \
  33 + apt-get install -y software-properties-common curl wget && \
  34 + add-apt-repository ppa:mc3man/trusty-media && \
  35 + curl -sL https://deb.nodesource.com/setup | sudo bash - && \
  36 + apt-get -y update && \
  37 + apt-get install -y ffmpeg gstreamer0.10-ffmpeg pkg-config libfreetype6-dev libpng-dev xvfb python-yaml libgomp1 python-numpy python-pyfits python-matplotlib idle build-essential libssl-dev sudo nodejs python-pip && \
  38 + apt-get clean && \
  39 + groupadd -r vlibras && useradd -r -g vlibras vlibras && \
  40 + pip install pika && \
  41 + pip install nltk==3.0.5 nltk_tgrep --upgrade && \
  42 + pip install pysrt pyvirtualdisplay && \
  43 + mkdir /storage/ && \
  44 + mkdir -p /storage/videos/ && \
  45 + chown -R vlibras /storage/
  46 +
  47 +WORKDIR /home/vlibras/vlibras-api/
  48 +
  49 +COPY ./docker-entrypoint.sh /
  50 +
  51 +RUN npm cache clean && \
  52 + rm -rf node_modules && \
  53 + npm i && \
  54 + npm install amqplib && \
  55 + mkdir -p /home/vlibras/vlibras-api/logsystem/logs && \
  56 + chown -R vlibras. /home/vlibras && \
  57 + apt-get purge -y build-essential && \
  58 + chmod +x /docker-entrypoint.sh
  59 +
  60 +USER vlibras
  61 +
  62 +EXPOSE 8080
  63 +VOLUME ["/storage"]
  64 +VOLUME ["/home/vlibras/vlibras-api/logsystem/logs"]
  65 +
  66 +ENTRYPOINT ["/docker-entrypoint.sh"]
... ...