This commit is contained in:
2025-10-21 10:13:57 +02:00
parent d3b100192c
commit d3d99a1048
4 changed files with 42 additions and 0 deletions

7
.dockerignore Normal file
View File

@@ -0,0 +1,7 @@
node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
.env

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM node:22-alpine AS build
WORKDIR /app
# Copie des dépendances
COPY package*.json ./
RUN npm ci --only=production
# Copie du code source
COPY . .
# Étape 2 : image finale
FROM node:22-alpine
WORKDIR /app
# Copie uniquement les fichiers nécessaires
COPY --from=build /app ./
EXPOSE 3000
# Commande de démarrage
CMD ["node", "src/index.js"]

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
docker build -t mon-app .
http://localhost:3000

9
compose.yml Normal file
View File

@@ -0,0 +1,9 @@
services:
app:
image: node:22-alpine
working_dir: /app
volumes:
- .:/app
ports:
- "3000:3000"
command: npm run dev