Skip to content

Commit

Permalink
Finalizando o exemplo-2 do Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
glaucia86 committed Aug 3, 2019
1 parent 0694762 commit ab225d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion exemplo-2/Dockerfile
Expand Up @@ -4,8 +4,10 @@ WORKDIR /app

COPY . .

ENV PORT=3000

RUN npm install

EXPOSE 3000
EXPOSE $PORT

ENTRYPOINT ["node", "app.js"]
4 changes: 2 additions & 2 deletions exemplo-2/app.js
Expand Up @@ -9,7 +9,7 @@ const express = require('express');

const app = express();

const port = process.env.PORT || 3000;
const port = process.env.PORT;

app.get('/', (req, res) => {
res.status(200).send({
Expand All @@ -20,4 +20,4 @@ app.get('/', (req, res) => {
});

app.listen(port);
console.log('Aplicação executando na porta ', port);
console.log(`Aplicação executando na porta..: ${port}`);

0 comments on commit ab225d5

Please sign in to comment.