mirror of
https://github.com/nethunterzist/trendyol-analiz
synced 2026-07-05 02:57:03 +00:00
fix: bundle categories into Docker image for Coolify deployment
Coolify remaps volume mounts to its own managed directories, so ./categories was mapped to an empty dir instead of the repo data. Changes: - Backend build context changed to repo root (.) so categories/ is accessible - Dockerfile copies categories into /data/initial-categories/ - startup.sh seeds /data/categories from bundled data if empty - Removed categories volume mount (reports still persisted via volume) - Added root .dockerignore (categories NOT excluded) - Updated CI workflow to match new build context Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,17 @@ if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Seed categories data from bundled initial-categories if /data/categories is empty
|
||||
if [ -d "/data/initial-categories" ] && [ "$(ls -A /data/initial-categories 2>/dev/null)" ]; then
|
||||
if [ -z "$(ls -A /data/categories 2>/dev/null)" ]; then
|
||||
echo "📂 Seeding categories from bundled data..."
|
||||
cp -r /data/initial-categories/* /data/categories/
|
||||
echo "✅ $(ls /data/categories | wc -l) category files copied!"
|
||||
else
|
||||
echo "📂 Categories directory already has data, skipping seed."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run migrations
|
||||
echo "🔄 Running database migrations..."
|
||||
alembic upgrade head
|
||||
|
||||
Reference in New Issue
Block a user