Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piki_Pr/1 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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