├── package.json ├── index.js ├── README.md └── LICENSE /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docker-nodejs", 3 | "private": true, 4 | "version": "0.0.1", 5 | "description": "NodeJS example", 6 | "author": "Gonzalo", 7 | "scripts": { 8 | "start": "node index.js", 9 | "test": "mocha index.test.js" 10 | }, 11 | "dependencies": { 12 | "express": "*" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | 3 | const PORT = 8888; 4 | 5 | var app = express(); 6 | 7 | app.get('/', function (req, res) { 8 | console.log(req); 9 | res.send('Bienvenido'); 10 | }); 11 | 12 | app.get('/:name', function (req, res) { 13 | console.log(req); 14 | res.send('Hola ' + req.params.name); 15 | }); 16 | 17 | app.listen(PORT); 18 | console.log('Running on http://localhost:' + PORT); 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PRÁCTICAS MÓDULO CLOUD 2 | 3 | ## Preparación 4 | 5 | * Cuenta de [Docker Hub](https://hub.docker.com/) 6 | * Cuenta de [AWS](http://aws.amazon.com/) 7 | * Haz un fork de este repositorio 8 | 9 | ## Práctica 1 10 | 11 | Dado este proyecto en NodeJS, crea su Dockerfile sabiendo que nos han pedido como imagen base ubuntu:18.04, versión 10 de NodeJS, el 8888 será el puerto donde exponga la comunicación la applicación, la señal de *STOP* debe llegarle a la aplicación y el contenedor podría ser iniciado con cualquier proceso. 12 | 13 | ## Práctica 2 14 | 15 | Sube la imagen de Docker a DockerHub. 16 | 17 | ## Práctica 3 18 | 19 | Automatiza el proceso de creación de la imagen de Docker y su subida a Docker Hub después de cada cambio en el repositorio utitlizando Travis CI. 20 | 21 | ## Práctica 4 22 | 23 | Crea un servidor y despliega la imagen de Docker en AWS utilizando Terraform. 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Lemoncode 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------