deploy(core): add docker files

This commit is contained in:
2026-04-21 21:23:02 +02:00
parent 762b03c291
commit e6d07d05cd
4 changed files with 73 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# ---------- BUILD STAGE ----------
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
RUN npm run build
# ---------- RUN STAGE ----------
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# nur notwendige files kopieren (viel kleiner!)
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]
+19
View File
@@ -0,0 +1,19 @@
services:
homepage:
build:
context: .
image: byhaider-homepage:latest
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.byhaider-homepage.rule=Host(`byhaider.dev`)"
- "traefik.http.routers.byhaider-homepage.entrypoints=websecure"
- "traefik.http.routers.byhaider-homepage.tls=true"
- "traefik.http.routers.byhaider-homepage.tls.certResolver=cloudflare"
- "traefik.http.services.byhaider-homepage.loadbalancer.server.port=3000"
networks:
- traefik-network
networks:
traefik-network:
external: true
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
echo "🚀 Starte Deployment für byHaider-Homepage..."
cd ~/byhaider-homepage
echo "📥 Pull latest changes for byhaider-homepage..."
git pull origin main
echo "🛑 Stoppe alte Container..."
docker compose down
echo "📦 Baue Images neu..."
docker compose build
echo "⬆️ Starte Container..."
docker compose up -d
echo "🧹 Bereinige alte Images..."
docker image prune -f
echo "✅ Deployment abgeschlossen!"
docker compose ps
+1
View File
@@ -3,6 +3,7 @@ import createNextIntlPlugin from "next-intl/plugin";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
/* config options here */ /* config options here */
output: 'standalone',
}; };
const withNextIntl = createNextIntlPlugin(); const withNextIntl = createNextIntlPlugin();