add docker files

This commit is contained in:
canguilieme julien 2024-10-13 18:34:26 +02:00
parent a30537f9e7
commit 93a417c5d9
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
FROM node:18
# Crée un répertoire de travail dans le conteneur
WORKDIR /app/src
WORKDIR /app
# Copie les fichiers package.json et package-lock.json pour installer les dépendances
COPY src/ .

View File

@ -6,12 +6,12 @@ const path = require('path');
const app = express();
// Serve static files from the 'src' directory
app.use(express.static(path.join(__dirname, 'src')));
app.use(express.static(path.join(__dirname, '')));
// Define a route to serve the HTML file
app.get('/', (req, res) => {
// Send the HTML file as the response
res.sendFile(path.join(__dirname, 'src/index.html'));
res.sendFile(path.join(__dirname, 'index.html'));
});
// Start the server