Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:lts-alpine3.9

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 8080
CMD [ "node", "index.js" ]
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "building image..."
docker build -t toumi007/logger-app:v1 .

echo "pushing the image to docker.hub..."
docker push toumi007/logger-app:v1
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "2"
services:
logger-app:
image: toumi007/logger-app:v1
ports:
- "8080:8080"
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const express = require('express')
const bodyParser = require('body-parser')
const hc = process.env.HEALTHCHECK || '/hc'
const app = express()
const PORT = 8080

app.use(bodyParser.text({type: "*/*", limit: '50mb'}))
app.get(hc, (req, res) => res.send('OK'))
Expand All @@ -12,4 +13,4 @@ app.use((err, req, res, next) => {
console.log('ERROR =>', err)
res.status(500).send("500")
})
app.listen(PORT, () => console.log(`logger app listening on port xxx!`))
app.listen(PORT, () => console.log("logger app listening on port "+PORT+"!"))
Loading