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: services:
visio: visio:
image: node:20-alpine build:
container_name: visio-app context: .
working_dir: /app dockerfile: Dockerfile
volumes:
- ./:/app container_name: visio
- /app/node_modules
ports: ports:
- "3010:3000" - "${APP_PORT}:3000"
environment:
- PORT=3000 env_file:
command: sh -c "npm install && npm run build && npm start" - .env
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"] test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
start_period: 40s start_period: 20s
+3 -1
View File
@@ -1,7 +1,9 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
/* config options here */ output: "standalone",
compress: true,
poweredByHeader: false,
}; };
export default nextConfig; export default nextConfig;
+3 -2
View File
@@ -3,9 +3,10 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "node server.js", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "NODE_ENV=production node server.js", "start": "node .next/standalone/server.js",
"docker": "docker compose up --build",
"lint": "eslint" "lint": "eslint"
}, },
"dependencies": { "dependencies": {