This commit is contained in:
root
2025-09-30 08:42:05 +00:00
parent b33e9e587b
commit 2b284195fb
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -31,6 +31,7 @@ RUN npm ci --only=production
# Backend-Code kopieren # Backend-Code kopieren
COPY backend/ ./ COPY backend/ ./
COPY backend/docker-entrypoint.sh ./docker-entrypoint.sh
# public leeren # public leeren
RUN rm -rf ./public/* RUN rm -rf ./public/*
@@ -38,6 +39,9 @@ RUN rm -rf ./public/*
# frische Datenbank vorbereiten # frische Datenbank vorbereiten
RUN rm -rf ./data && mkdir -p ./data && chown node:node ./data RUN rm -rf ./data && mkdir -p ./data && chown node:node ./data
# EntryPoint vorbereiten
RUN chmod +x ./docker-entrypoint.sh && chown node:node ./docker-entrypoint.sh
# Inhalt von dist inklusive Unterordner direkt nach public kopieren # Inhalt von dist inklusive Unterordner direkt nach public kopieren
COPY --from=frontend-build /app/frontend/dist/. ./public/ COPY --from=frontend-build /app/frontend/dist/. ./public/
@@ -53,4 +57,5 @@ EXPOSE 5173
USER node USER node
# Container startet das Backend (liefert statisches Frontend) # Container startet das Backend (liefert statisches Frontend)
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["node", "index.js"] CMD ["node", "index.js"]
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
set -e
echo "🔧 Starte Migration (idempotent)..."
node db/migrate.js
echo "✅ Migration abgeschlossen. Starte Anwendung..."
exec "$@"