Separate CP admin panel into independent Vite project at /cp/

- New /cp/ Vite project with own package.json, Dockerfile, tailwind config
- Migrated CpLoginPage, CpLayout, AdminDashboard → cp/src/ (self-contained)
- cp/src/lib/utils.ts has only what CP needs (cn, PLAN_LABELS, PLAN_COLORS)
- cp/src/data/mockData.ts has Hotel/User types and mock data
- cp/ builds to nginx static container (hotelsync-cp)
- docker-compose.yml: added cp service
- nginx: added cp.hotelsync.ru → hotelsync-cp:80 (SSL block ready for certbot)
- deploy.yml: builds hotelsync-cp:latest and restarts container on push
- Cleaned src/App.tsx: removed IS_CP branch, CpLoginPage/CpLayout/AdminDashboard imports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 01:03:28 +03:00
parent 5429b272f9
commit 526a9eefcf
21 changed files with 801 additions and 43 deletions

View File

@@ -20,11 +20,12 @@ jobs:
- name: Copy env
run: cp /opt/hotelsync/.env /opt/hotelsync/app/.env
- name: Build Docker image
- name: Build Docker images
run: |
cd /opt/hotelsync/app
docker build -t hotelsync-frontend:latest .
echo "✅ Image built"
docker build -t hotelsync-cp:latest ./cp
echo "✅ Images built"
- name: Restart frontend container
run: |
@@ -35,7 +36,18 @@ jobs:
--network hotelsync_hotelsync-net \
--restart unless-stopped \
hotelsync-frontend:latest
echo "✅ Container started"
echo "✅ Frontend started"
- name: Restart CP container
run: |
docker stop hotelsync-cp 2>/dev/null || true
docker rm hotelsync-cp 2>/dev/null || true
docker run -d \
--name hotelsync-cp \
--network hotelsync_hotelsync-net \
--restart unless-stopped \
hotelsync-cp:latest
echo "✅ CP started"
- name: Health check
run: |