Docker Image erstellt

This commit is contained in:
MBO-Tech-IT 2026-04-26 13:14:15 +02:00
parent fdbf3c0219
commit 9a021b932c
5 changed files with 39 additions and 2 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
RUN addgroup --system nodejs && adduser --system --ingroup nodejs nextjs
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]

10
docker-compose.yaml Normal file
View File

@ -0,0 +1,10 @@
services:
web:
build: .
image: mbo-tech-it-web
container_name: mbo-tech-it
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production

View File

@ -1,5 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {};
const nextConfig: NextConfig = {
output: "standalone",
};
export default nextConfig;

View File

@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "node --max-old-space-size=4096 node_modules/.bin/next dev",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"

1
tsconfig.tsbuildinfo Normal file

File diff suppressed because one or more lines are too long