Add automatic database migrations on startup

This commit is contained in:
cawcenter
2025-12-16 11:29:12 -05:00
parent 22515b83b1
commit 89f895b3a8
3 changed files with 74 additions and 2 deletions

View File

@@ -70,5 +70,8 @@ USER astro
# Expose Port
EXPOSE 4321
# Launch with optimized settings
CMD ["node", "./dist/server/entry.mjs"]
# Create startup script that runs migrations then starts server
RUN echo '#!/bin/sh\necho "🔧 Running database migrations..."\nnode scripts/run-migrations.js || echo "⚠️ Migrations failed (continuing anyway)"\necho "🚀 Starting God Mode..."\nexec node ./dist/server/entry.mjs' > /app/start.sh && chmod +x /app/start.sh
# Launch with migrations + server
CMD ["/app/start.sh"]