Commit 7b780d38beb6720f791c7c0885ed3277ba2778f0
Committed by
GitHub
1 parent
6cea5425
Exists in
master
Removed docker tutorial from readme
Showing
1 changed file
with
0 additions
and
175 deletions
Show diff stats
README.md
@@ -333,182 +333,7 @@ Once this is done, the breadcrumbs of the 'Create discipline' page is as follows | @@ -333,182 +333,7 @@ Once this is done, the breadcrumbs of the 'Create discipline' page is as follows | ||
333 | 333 | ||
334 | [Home]() / [Courses]() / [Course Name]() / Create Subject | 334 | [Home]() / [Courses]() / [Course Name]() / Create Subject |
335 | 335 | ||
336 | -## 1. Docker | ||
337 | -O Docker possui um Daemon para gerenciamento de conteiners. Sua instalação possui uma documentação oficial e pode ser conferida nas páginas: | ||
338 | 336 | ||
339 | -[Instalando Docker no Windows](https://docs.docker.com/docker-for-windows/) | ||
340 | - | ||
341 | -[Instalando Docker no Mac OSX](https://docs.docker.com/docker-for-mac/) | ||
342 | - | ||
343 | -[Instalando Docker no Ubuntu](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) | ||
344 | - | ||
345 | -## 2. Importando conteiner Docker do Amadeus LMS | ||
346 | - | ||
347 | -Com o Docker instalado, é possível importar uma imagem pré-configurada do Amadeus LMS comos seguintes comandos: | ||
348 | - | ||
349 | -Baixe a imagem diretamente do repositório do Amadeus LMS: | ||
350 | -``` bash | ||
351 | -sudo docker pull filipecmedeiros/amadeus:1.0 | ||
352 | -``` | ||
353 | -Execute o conteiner: | ||
354 | -``` bash | ||
355 | -sudo docker run -itp 8000:80 filipecmedeiros/amadeus:1.0 | ||
356 | -``` | ||
357 | -Inicie o banco de dados Postgres e o servidor web Nginx: | ||
358 | -``` bash | ||
359 | -/etc/init.d/postgresql start | ||
360 | -/etc/init.d/nginx start | ||
361 | -``` | ||
362 | - | ||
363 | -Obs.: Espere alguns minutos até o servidor iniciar. | ||
364 | - | ||
365 | -Execute o Amadeus: | ||
366 | -``` bash | ||
367 | -cd /home/amadeuslms/ | ||
368 | -gunicorn amadeus.wsgi:application | ||
369 | -``` | ||
370 | - | ||
371 | -Para sair do docker e continuar com o Amadeus LMS executando no container só é preciso apertar crtl + p + q. | ||
372 | - | ||
373 | -## 3. Exportando conteiner Docker com Amadeus | ||
374 | - | ||
375 | -Para gerar sua própria imagem do Amadeus, disponibilizamos um exemplo utilizando Ubuntu 16.04 LTS + Postgres + Nginx: | ||
376 | - | ||
377 | -### 3.1 Preparando o conteiner | ||
378 | -Faça o download de uma imagem do ubuntu: | ||
379 | -``` bash | ||
380 | -sudo docker pull ubuntu:16.04 | ||
381 | -``` | ||
382 | -Execute o conteiner a partir da imagem do ubuntu que acabou de ser baixada: | ||
383 | -``` bash | ||
384 | -sudo docker run -itp 8000:80 ubuntu:16.04 | ||
385 | -``` | ||
386 | -Antes de tudo, é necessário fazer um update para poder fazer o download de qualquer software: | ||
387 | -``` bash | ||
388 | -apt-get update | ||
389 | -``` | ||
390 | -A linguagem padrão utilizada é ASC II, faça a migração para UTF-8: | ||
391 | -``` bash | ||
392 | -export LANG=C.UTF-8 | ||
393 | -``` | ||
394 | -Após estes passos, o conteiner está preparado para fazer o download dos softwares e dependências | ||
395 | -necessárias: | ||
396 | -``` bash | ||
397 | -apt-get install nano gettext nginx python3 python3-pip git postgresql postgresql-contrib libpq-dev | ||
398 | -python3-dev | ||
399 | -``` | ||
400 | -Inicie o banco de dados Postgres: | ||
401 | -``` bash | ||
402 | -/etc/init.d/postgresql start | ||
403 | -``` | ||
404 | -Inicie o servidor web Nginx: | ||
405 | -``` bash | ||
406 | -/etc/init.d/nginx start | ||
407 | -``` | ||
408 | -### 3.2 Preparando o banco de dados Postgres | ||
409 | - | ||
410 | -Faça login como usuário admin do Postgres: | ||
411 | -``` bash | ||
412 | -su postgres | ||
413 | -``` | ||
414 | -Crie um banco de dados: | ||
415 | -``` bash | ||
416 | -createdb amadeus | ||
417 | -``` | ||
418 | -Para executar comandos SQL, utilize o comando: | ||
419 | -```bash | ||
420 | -psql | ||
421 | -``` | ||
422 | -Então execute o comando para criar um usuário do Amadeus no banco de dados: | ||
423 | -``` sql | ||
424 | -CREATE ROLE amadeus_admin WITH LOGIN SUPERUSER PASSWORD 'amadeus'; | ||
425 | -``` | ||
426 | -Para sair, execute: | ||
427 | -``` sql | ||
428 | -/q | ||
429 | -``` | ||
430 | -E em seguida, para sair do usuário Postgres: | ||
431 | -``` bash | ||
432 | -exit | ||
433 | -``` | ||
434 | -### 3.3 Preparando o Amadeus | ||
435 | -Faça o download do Amadeus a partir do repositório git: | ||
436 | -``` bash | ||
437 | -git clone https://github.com/amadeusproject/amadeuslms.git | ||
438 | -``` | ||
439 | -Crie um arquivo chamado local_settings.py no diretório /amadeuslms/amadeus/ : | ||
440 | -```bash | ||
441 | -nano /amadeuslms/amadeus/local_settings.py | ||
442 | -``` | ||
443 | -E adicione os valores do banco de dados que acabou de ser criado: | ||
444 | -``` python | ||
445 | -import os | ||
446 | -DEBUG = True | ||
447 | -DATABASES = { | ||
448 | - 'default': { | ||
449 | - 'ENGINE': 'django.db.backends.postgresql', | ||
450 | - 'NAME': 'amadeus', | ||
451 | - 'USER': 'amadeus_admin', | ||
452 | - 'PASSWORD': 'amadeus', | ||
453 | - 'HOST': '127.0.0.1', | ||
454 | - 'PORT': '5432', | ||
455 | - } | ||
456 | -} | ||
457 | - ``` | ||
458 | -Aplique as migrações do Amadeus ao banco de dados: | ||
459 | -```bash | ||
460 | -cd amadeuslms/ | ||
461 | -python3 manage.py migrate | ||
462 | -``` | ||
463 | -Ative as configurações de tradução do Amadeus: | ||
464 | -```bash | ||
465 | -python3 manage.py compilemessages | ||
466 | -``` | ||
467 | -Crie o usuário Admin do Amadeus: | ||
468 | -``` bash | ||
469 | -python3 manage.py createsuperuser | ||
470 | -``` | ||
471 | -### 3.4 Preparando o Nginx | ||
472 | -Para fazer a configuração do Nginx, edite o arquivo default localizado em /etc/nginx/sitesavaliables e adicione as configurações: | ||
473 | -``` bash | ||
474 | -nano /etc/nginx/sites-avaliables/default | ||
475 | -``` | ||
476 | -``` bash | ||
477 | -upstream backend { | ||
478 | - server localhost:8000; | ||
479 | -} | ||
480 | -server { | ||
481 | - listen 80 default_server; | ||
482 | - listen 443 ssl; | ||
483 | - server_name _; | ||
484 | - | ||
485 | - root /home/amadeuslms; | ||
486 | - index index.html; | ||
487 | - charset utf-8; | ||
488 | - location / { | ||
489 | - try_files $uri @proxy_to_app; | ||
490 | - } | ||
491 | - location /uploads { | ||
492 | - autoindex on; | ||
493 | - alias /home/amadeuslms/amadeus/uploads/; | ||
494 | - } | ||
495 | - location @proxy_to_app { | ||
496 | - proxy_pass http://backend; | ||
497 | - proxy_http_version 1.1; | ||
498 | - proxy_set_header Upgrade $http_upgrade; | ||
499 | - proxy_set_header Connection "upgrade"; | ||
500 | - proxy_set_header Host $http_host; | ||
501 | - } | ||
502 | -} | ||
503 | -``` | ||
504 | - | ||
505 | -Para executar o Amadeus LMS: | ||
506 | -``` bash | ||
507 | -cd /home/amadeuslms/ | ||
508 | -gunicorn amadeus.wsgi:application | ||
509 | -``` | ||
510 | - | ||
511 | -Para sair do docker e continuar com o Amadeus LMS executando no container só é preciso apertar crtl + p + q. | ||
512 | ## Link's úteis | 337 | ## Link's úteis |
513 | [Git - Introdução e comandos básicos(PT-BR)](https://github.com/fernandomayer/git-rautu/blob/master/0_configuracao-inicial.md) | 338 | [Git - Introdução e comandos básicos(PT-BR)](https://github.com/fernandomayer/git-rautu/blob/master/0_configuracao-inicial.md) |
514 | 339 |