fix: Docker deployment fully functional
- Entrypoint: run migrate + seed before caching config - docker-compose: pass ADMIN_EMAIL/ADMIN_PASSWORD/RUN_SEEDER to app - All 5 containers start healthy: app, postgres, nginx, pgadmin, adminer - Login page returns 200, API login works, migrations+seeding run on boot
This commit is contained in:
@@ -18,6 +18,9 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- RUN_MIGRATIONS=true
|
- RUN_MIGRATIONS=true
|
||||||
|
- RUN_SEEDER=true
|
||||||
|
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
|
||||||
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
container_name: tckdev-db
|
container_name: tckdev-db
|
||||||
|
|||||||
@@ -21,12 +21,16 @@ if [ ! -d "public/build" ] && [ -f "vite.config.js" ]; then
|
|||||||
npm run build || true
|
npm run build || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
php artisan config:cache 2>/dev/null || true
|
|
||||||
php artisan route:cache 2>/dev/null || true
|
|
||||||
php artisan view:cache 2>/dev/null || true
|
|
||||||
|
|
||||||
if [ "$RUN_MIGRATIONS" = "true" ]; then
|
if [ "$RUN_MIGRATIONS" = "true" ]; then
|
||||||
php artisan migrate --force || true
|
php artisan migrate --force || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$RUN_SEEDER" = "true" ]; then
|
||||||
|
php artisan db:seed --force 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
php artisan config:cache 2>/dev/null || true
|
||||||
|
php artisan route:cache 2>/dev/null || true
|
||||||
|
php artisan view:cache 2>/dev/null || true
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user