6 changed files with 127 additions and 23 deletions
@ -1,3 +1,11 @@ |
|||||||
|
Fase III |
||||||
|
|
||||||
Primera tarefa: |
Primera tarefa: |
||||||
|
|
||||||
Implemente um serviço REST em NodeJS que exponha o endpoint "/token" que receba o JSON "{user:'user1', password:'pass1'}" e retorne um token JWT caso sucesso, ou status 500 caso contrário. |
Implemente um serviço REST em NodeJS que exponha o endpoint "/token" que receba o JSON "{user:'user1', password:'pass1'}" e retorne um token JWT caso sucesso, ou status 500 caso contrário. |
||||||
|
|
||||||
|
Segunda tarefa: |
||||||
|
|
||||||
|
Crie uma página HTML que solicite usuário/senha, invoque o serviço da primeira tarefa e mostre a mensagem "Autenticado com sucesso" ou "Falha na autenticação". |
||||||
|
|
||||||
|
Essa página deve estar em um segundo container e servida por NGINX. Mande o print da sua tela! |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
version: '3' |
||||||
|
services: |
||||||
|
nginx: |
||||||
|
container_name: nginx |
||||||
|
depends_on: |
||||||
|
- app |
||||||
|
restart: always |
||||||
|
build: ./nginx |
||||||
|
image: custom/nginx |
||||||
|
ports: |
||||||
|
- 8000:8000 |
||||||
|
networks: |
||||||
|
- network_1 |
||||||
|
app: |
||||||
|
container_name: app |
||||||
|
depends_on: |
||||||
|
- mongo |
||||||
|
restart: always |
||||||
|
build: ./node |
||||||
|
image: custom/node |
||||||
|
networks: |
||||||
|
- network_1 |
||||||
|
- network_2 |
||||||
|
mongo: |
||||||
|
container_name: mongo |
||||||
|
build: ./mongo |
||||||
|
image: custom/mongo |
||||||
|
environment: |
||||||
|
MONGO_INITDB_ROOT_USERNAME: root |
||||||
|
MONGO_INITDB_ROOT_PASSWORD: ruth |
||||||
|
networks: |
||||||
|
- network_2 |
||||||
|
ports: |
||||||
|
- 27017:27017 |
||||||
|
prometheus: |
||||||
|
container_name: prometheus |
||||||
|
image: prom/prometheus:latest |
||||||
|
volumes: |
||||||
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml |
||||||
|
networks: |
||||||
|
- network_2 |
||||||
|
ports: |
||||||
|
- 9090:9090 |
||||||
|
grafana: |
||||||
|
container_name: grafana |
||||||
|
image: grafana/grafana |
||||||
|
networks: |
||||||
|
- network_2 |
||||||
|
ports: |
||||||
|
- 3000:3000 |
||||||
|
networks: |
||||||
|
network_1: |
||||||
|
ipam: |
||||||
|
driver: default |
||||||
|
config: |
||||||
|
- subnet: 192.168.5.0/24 |
||||||
|
network_2: |
||||||
|
ipam: |
||||||
|
driver: default |
||||||
|
config: |
||||||
|
- subnet: 192.168.6.0/24 |
||||||
@ -0,0 +1,21 @@ |
|||||||
|
<body> |
||||||
|
<div> |
||||||
|
<h1>WELCOME, MAGUILA</h1> |
||||||
|
</div> |
||||||
|
<div class="form-header" style="background-color:black; color:white; padding:20px; left:50%; "> |
||||||
|
<h2>Authenticate thyself</h2> |
||||||
|
</div> |
||||||
|
<form method="post" action="/token" novalidate> |
||||||
|
<div class="form-field" style="background-color:black; color:white; padding:20px; left:50%; "> |
||||||
|
<label for="message">Username</label> |
||||||
|
<input class="input" id="username" name="username" autofocus > |
||||||
|
</div> |
||||||
|
<div class="form-field" style="background-color:black; color:white; padding:20px; left:50%; "> |
||||||
|
<label for="email">Password</label> |
||||||
|
<input class="input" id="password" name="password" type="password" value="" /> |
||||||
|
</div> |
||||||
|
<div class="form-actions" style="background-color:black; color:white; padding:20px; left:50%; "> |
||||||
|
<button class="btn" type="submit">LOGIN</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</body> |
||||||
Loading…
Reference in new issue