Skip to content

Commit

Permalink
docker composer
Browse files Browse the repository at this point in the history
  • Loading branch information
aomerge committed Jun 8, 2023
1 parent 999cc99 commit 0514b43
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dockerfile
./package-lock.json
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'

services:
web:
image: node:16-alpine
working_dir: /app
volumes:
- .:/app
command: npm run start
ports:
- 4000:4000
volumes:
app:
204 changes: 204 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions rules/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator Terminal Rules</title>
<style>
body {
font-family: sans-serif;
background-color: #ffffff;
color: #000000;
}
</style>
</head>
<body>
<h1>Calculator Terminal Rules</h1>
<p>The calculator terminal is a powerful tool that can be used to perform calculations. However, there are some rules that you should follow when using the calculator terminal.</p>
<ul>
<li style="color:red;">Do not type any commands that you do not understand.</li>
<li style="color:orange;">Do not type any commands that could damage your computer.</li>
<li style="color:green;">Do not type any commands that could violate the privacy of others.</li>
</ul>
<p>If you have any questions about the calculator terminal, please consult the documentation or contact your system administrator.</p>

</body>
</html>

20 changes: 20 additions & 0 deletions rules/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const http = require('http');
const fs = require('fs');
const path = require('path');

const port = 4000; // Puerto en el que se ejecutará el servidor

http.createServer((req, res) => {
const filePath = path.join(__dirname, 'index.html'); // Ruta al archivo HTML
fs.readFile(filePath, 'utf8', (err, content) => {
if (err) {
res.writeHead(500);
res.end(`Error al leer el archivo: ${err}`);
return;
}
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(content);
});
}).listen(port);

console.log(`Servidor ejecutándose en http://localhost:${port}`);

0 comments on commit 0514b43

Please sign in to comment.