Merge pull request 'feat(ops): add media seeding step and configure presigned media endpoint' (#2) from vps-data-fix into main
Reviewed-on: https://10.10.0.4/AcuPedia/acupedia-ops/pulls/2 Reviewed-by: Amit Salunke <amit@noreply.localhost>
This commit is contained in:
commit
5fcde8dc4b
|
|
@ -88,7 +88,49 @@ docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Step 3.4: Seed Commerce Plans
|
### Step 3.4: Seed Clinical Media Assets (Images to MinIO)
|
||||||
|
Seeds all 787 anatomical images, channel pathways, and charts across the 4 visual modules into MinIO object storage (`accupedia-media` bucket) and links them to their respective content items in PostgreSQL:
|
||||||
|
|
||||||
|
**Option A (Recommended — Automated 1-line loop for all 4 modules):**
|
||||||
|
```bash
|
||||||
|
for m in m0001-acupuncture-points m0002-ear-acupuncture m0003-scalp-acupuncture m0031-nutrition; do
|
||||||
|
docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
acupedia-bootstrap media \
|
||||||
|
--manifest /app/content/$m/media.json \
|
||||||
|
--media-root /app/content/$m
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
**Option B (Run module-by-module individually):**
|
||||||
|
```bash
|
||||||
|
# 1. Acupuncture Points (418 images — acupoints, channels, and extraordinary vessels like Chong Mai)
|
||||||
|
docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
acupedia-bootstrap media \
|
||||||
|
--manifest /app/content/m0001-acupuncture-points/media.json \
|
||||||
|
--media-root /app/content/m0001-acupuncture-points
|
||||||
|
|
||||||
|
# 2. Ear Acupuncture (336 images — ear reflexology points)
|
||||||
|
docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
acupedia-bootstrap media \
|
||||||
|
--manifest /app/content/m0002-ear-acupuncture/media.json \
|
||||||
|
--media-root /app/content/m0002-ear-acupuncture
|
||||||
|
|
||||||
|
# 3. Scalp Acupuncture (18 images — scalp zones)
|
||||||
|
docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
acupedia-bootstrap media \
|
||||||
|
--manifest /app/content/m0003-scalp-acupuncture/media.json \
|
||||||
|
--media-root /app/content/m0003-scalp-acupuncture
|
||||||
|
|
||||||
|
# 4. Nutrition (15 images — dietary reference charts)
|
||||||
|
docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
acupedia-bootstrap media \
|
||||||
|
--manifest /app/content/m0031-nutrition/media.json \
|
||||||
|
--media-root /app/content/m0031-nutrition
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Step 3.5: Seed Commerce Plans
|
||||||
Seeds subscription plans, billing periods, pricing, and links them to the seeded modules from `/app/content/plans.json`:
|
Seeds subscription plans, billing periods, pricing, and links them to the seeded modules from `/app/content/plans.json`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -98,8 +140,13 @@ docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
### Step 3.6: Validate Database Integrity
|
||||||
|
Verifies all 9 required tables exist, counts roles, permissions, modules, published content items, and seeded media assets:
|
||||||
|
=======
|
||||||
### Step 3.5: Validate Database Integrity
|
### Step 3.5: Validate Database Integrity
|
||||||
Verifies all 9 required tables exist, counts roles, permissions, modules, and published content items:
|
Verifies all 9 required tables exist, counts roles, permissions, modules, and published content items:
|
||||||
|
>>>>>>> origin/main
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.dev.yml exec backend \
|
docker compose -f docker-compose.dev.yml exec backend \
|
||||||
|
|
@ -122,7 +169,7 @@ Expected output:
|
||||||
"permission_count": 6,
|
"permission_count": 6,
|
||||||
"module_count": 16,
|
"module_count": 16,
|
||||||
"content_count": 2476,
|
"content_count": 2476,
|
||||||
"media_asset_count": 0,
|
"media_asset_count": 787,
|
||||||
"access_plan_count": 2,
|
"access_plan_count": 2,
|
||||||
"missing_tables": []
|
"missing_tables": []
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ services:
|
||||||
# ============================================================
|
# ============================================================
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ${ACUPEDIA_API_PATH:-../acupedia_api}
|
context: ${ACUPEDIA_API_PATH:-../../acupedia-api}
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: acupedia-api
|
container_name: acupedia-api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
@ -97,7 +97,7 @@ services:
|
||||||
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
|
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
|
||||||
MINIO_SECURE: "false"
|
MINIO_SECURE: "false"
|
||||||
MINIO_BUCKET: ${MINIO_BUCKET_NAME:-accupedia-media}
|
MINIO_BUCKET: ${MINIO_BUCKET_NAME:-accupedia-media}
|
||||||
MEDIA_PRESIGN_ENDPOINT: http://localhost:9000
|
MEDIA_PRESIGN_ENDPOINT: ${MEDIA_PRESIGN_ENDPOINT:-http://localhost:9000}
|
||||||
MEDIA_STORAGE_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
|
MEDIA_STORAGE_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
|
||||||
MEDIA_STORAGE_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
|
MEDIA_STORAGE_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
|
||||||
MEDIA_STORAGE_BUCKET: ${MINIO_BUCKET_NAME:-accupedia-media}
|
MEDIA_STORAGE_BUCKET: ${MINIO_BUCKET_NAME:-accupedia-media}
|
||||||
|
|
@ -119,7 +119,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "${BACKEND_PORT:-8000}:8000"
|
- "${BACKEND_PORT:-8000}:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- ${CONTENT_PATH:-../acupedia_content/acupedia-content}:/app/content:ro
|
- ${CONTENT_PATH:-../../acupedia_content/acupedia-content}:/app/content:ro
|
||||||
networks:
|
networks:
|
||||||
- acupedia-net
|
- acupedia-net
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ services:
|
||||||
# ============================================================
|
# ============================================================
|
||||||
store:
|
store:
|
||||||
build:
|
build:
|
||||||
context: ${ACUPEDIA_STORE_PATH:-../acupedia_store_ui}
|
context: ${ACUPEDIA_STORE_PATH:-../../acupedia_store_ui}
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
VITE_BASE_PATH: ${VITE_STORE_BASE_PATH:-/store/}
|
VITE_BASE_PATH: ${VITE_STORE_BASE_PATH:-/store/}
|
||||||
|
|
@ -146,7 +146,7 @@ services:
|
||||||
# ============================================================
|
# ============================================================
|
||||||
admin:
|
admin:
|
||||||
build:
|
build:
|
||||||
context: ${ACUPEDIA_ADMIN_PATH:-../acupedia_web_ui}
|
context: ${ACUPEDIA_ADMIN_PATH:-../../acupedia_web_ui}
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
VITE_BASE_PATH: ${VITE_ADMIN_BASE_PATH:-/admin/}
|
VITE_BASE_PATH: ${VITE_ADMIN_BASE_PATH:-/admin/}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue