adaugat lab4 si lab5
Signed-off-by: hellisabove <robertnedela15@gmail.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
FROM node:21-alpine3.18
|
||||
|
||||
COPY package.json /
|
||||
RUN npm install
|
||||
|
||||
COPY server.js /usr/src/app/
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["node", "/usr/src/app/server.js"]
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "docker_web_app",
|
||||
"version": "1.0.0",
|
||||
"description": "Node.js on Docker",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"start": "node server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.16.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const express = require('express');
|
||||
|
||||
const PORT = 8080;
|
||||
const HOST = '0.0.0.0';
|
||||
|
||||
const app = express();
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World');
|
||||
});
|
||||
|
||||
app.listen(PORT, HOST);
|
||||
console.log(`Running on http://${HOST}:${PORT}`);
|
||||
Reference in New Issue
Block a user