- Remove Node.js from production image (was violating Must NOT Have constraint) - Add 'RUN cp -r /app/public /app/public-build' in build stage after npm run build - Replace 'npm run build' in boot-container.sh with 'cp -r /app/public-build/*' - Add chown www-data for SQLite DB file in init-app.sh - Remove git from production stage package list (not in plan spec) - Update ENTRYPOINT comment to reflect new asset sync approach
25 lines
477 B
Bash
Executable file
25 lines
477 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
cd /app
|
|
|
|
DB_PATH="/app/database/database.sqlite"
|
|
|
|
if [ -f "$DB_PATH" ]; then
|
|
echo "[init] Database already exists, skipping first-run init."
|
|
exit 0
|
|
fi
|
|
|
|
echo "[init] First run detected — initializing application..."
|
|
|
|
touch "$DB_PATH"
|
|
chown www-data:www-data "$DB_PATH"
|
|
chmod 664 "$DB_PATH"
|
|
|
|
if [ -z "${APP_KEY}" ]; then
|
|
echo "[init] Generating application key..."
|
|
php artisan key:generate --force
|
|
fi
|
|
|
|
echo "[init] First-run init complete."
|