update build production

This commit is contained in:
Puechberty Arthur
2026-06-10 21:19:54 +02:00
parent 739fa54719
commit 0f5257c099
5 changed files with 54 additions and 15 deletions
+6
View File
@@ -0,0 +1,6 @@
node_modules
.next
npm-debug.log
Dockerfile
docker-compose.yml
.git
+28
View File
@@ -0,0 +1,28 @@
# ===== BUILD =====
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ===== RUN =====
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Standalone output
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]
+14 -12
View File
@@ -1,20 +1,22 @@
services:
visio:
image: node:20-alpine
container_name: visio-app
working_dir: /app
volumes:
- ./:/app
- /app/node_modules
build:
context: .
dockerfile: Dockerfile
container_name: visio
ports:
- "3010:3000"
environment:
- PORT=3000
command: sh -c "npm install && npm run build && npm start"
- "${APP_PORT}:3000"
env_file:
- .env
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
start_period: 20s
+3 -1
View File
@@ -1,7 +1,9 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
output: "standalone",
compress: true,
poweredByHeader: false,
};
export default nextConfig;
+3 -2
View File
@@ -3,9 +3,10 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "node server.js",
"dev": "next dev",
"build": "next build",
"start": "NODE_ENV=production node server.js",
"start": "node .next/standalone/server.js",
"docker": "docker compose up --build",
"lint": "eslint"
},
"dependencies": {