Dev #2

Merged
Mboehmlaender merged 25 commits from dev into master 2025-09-25 09:27:00 +00:00
8 changed files with 137 additions and 2 deletions
Showing only changes of commit cab8139815 - Show all commits
+4
View File
@@ -0,0 +1,4 @@
PORT=4000
NODE_ENV=production
PORTAINER_URL=https://your-portainer.example.com
PORTAINER_API_KEY=your_api_key_here
+23
View File
@@ -0,0 +1,23 @@
# Stage 1: Frontend build
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Backend + static frontend
FROM node:20-alpine AS runtime
WORKDIR /app/backend
COPY backend/package.json backend/package-lock.json ./
RUN npm ci --only=production
COPY backend/ ./
COPY --from=frontend-build /app/frontend/build ./public
ENV NODE_ENV=production
EXPOSE 4000 # Port wird über .env gesetzt
RUN chown -R node:node /app/backend
USER node
CMD ["node", "index.js"]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+15
View File
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>StackPulse</title>
<script type="module" crossorigin src="/assets/index-a1f09468.js"></script>
<link rel="stylesheet" href="/assets/index-0842cd3a.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "${PORT}:${PORT}"
env_file:
- .env
restart: unless-stopped
+11 -2
View File
@@ -3,22 +3,31 @@ set -e
echo "🚀 Starte StackPulse Dev-Umgebung..." echo "🚀 Starte StackPulse Dev-Umgebung..."
# --- Backend ---
cd backend cd backend
npm install npm install
npm start & npm start &
BACK_PID=$! BACK_PID=$!
cd .. cd ..
# --- Frontend ---
cd frontend cd frontend
npm install npm install
npm run dev & npm run dev &
FRONT_PID=$! FRONT_PID=$!
# Optional: Kopiere Build-Dateien für Backend /public (nur für statisches Testen)
npm run build
cp -r dist ../backend/public
cd .. cd ..
echo "" echo ""
echo "✅ StackPulse läuft lokal:" echo "✅ StackPulse läuft lokal:"
echo "Frontend: http://localhost:5173" echo "Frontend (Vite Dev): http://localhost:5173"
echo "Backend: http://localhost:3300" echo "Backend API: http://localhost:3300"
echo "Frontend (statisch im Backend/public): http://localhost:4000"
echo "Beenden mit STRG+C" echo "Beenden mit STRG+C"
# Prozesse überwachen
wait $BACK_PID $FRONT_PID wait $BACK_PID $FRONT_PID
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
echo "🚀 Starte StackPulse Dev-Umgebung..."
cd backend
npm install
npm start &
BACK_PID=$!
cd ..
cd frontend
npm install
npm run dev &
FRONT_PID=$!
cd ..
echo ""
echo "✅ StackPulse läuft lokal:"
echo "Frontend: http://localhost:5173"
echo "Backend: http://localhost:3300"
echo "Beenden mit STRG+C"
wait $BACK_PID $FRONT_PID