4c1dc4082e
Build and Push Images / build-and-push (push) Has been cancelled
이전 세션들에서 작업된 아래 범위를 모두 포함: Fleet 서브시스템 (src/fleet/) - fleetDeviceService / fleetCommandService / fleetDeploymentService / fleetReleaseService - fleetMetricsService, fleetScriptService, fleetEdgeConfigService - Edge 디바이스 관리, 커맨드 발행, 배포/릴리스, 스크립트 동기화 Collector 확장 - centralMqttForwarder / centralForwarderConfigService - equipmentStateService, pythonHookRunner, scriptCache - Modbus/OPC-UA/S7/XGT 프로토콜 클라이언트 - targetDbIntrospection (저장 DB 조회) Routes / API - automationDashboardRoutes, centralForwarderRoutes, equipmentStateRoutes DB - importEdgeConfig (Python cached config → Pipeline DB) - seedDataSources (external_db_connections 초기 시드) 엣지 배포 리소스 - docker/edge/Dockerfile.backend.prod, Dockerfile.frontend.prod - docker/edge/docker-compose.edge.yml 프론트엔드 - admin/automaticMng (centralForwarder, dashboard, equipmentState) - admin/fleet (commands, devices, deployments, releases, scripts, alerts) - admin/pipeline-device 개선 (저장 DB 드롭다운, 태그 매핑 등) - ExternalDbConnectionModal, ScriptsManagerDialog 등 신규 컴포넌트 - lib/api: automationDashboard, centralForwarder, equipmentState, fleet docs/ - EDGE_SERVER_STRUCTURE, FLEET_COMPLETE, FLEET_EDGE_INTEGRATION, FLEET_HOOK_INTEGRATION Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
108 lines
4.0 KiB
YAML
108 lines
4.0 KiB
YAML
# ============================================================
|
|
# Pipeline Edge 배포 Compose
|
|
#
|
|
# 목적: 스피폭스 등 고객사 엣지 서버에 Pipeline을 올려
|
|
# 기존 Python data-collector + Kafka + forwarder를 완전 대체
|
|
#
|
|
# 실행:
|
|
# cd /home/wace/pipeline-edge
|
|
# docker compose -f docker-compose.edge.yml up -d
|
|
#
|
|
# 전제:
|
|
# - .env 파일에 DATABASE_URL, PASSWORD_ENCRYPTION_KEY, JWT_SECRET 설정
|
|
# - Harbor 레지스트리 로그인 완료 (docker login harbor.wace.me)
|
|
# - 엣지에서 PLC(예: 192.168.101.50:2004) 도달 가능
|
|
# - 엣지에서 IDC EMQX (211.115.91.170:31883) 도달 가능
|
|
# ============================================================
|
|
|
|
services:
|
|
pipeline-backend:
|
|
image: ${PIPELINE_IMAGE:-harbor.wace.me/vexplor_fleet/pipeline-backend:latest}
|
|
container_name: pipeline-backend
|
|
restart: always
|
|
ports:
|
|
- "8080:8080" # REST API + Admin UI
|
|
- "1883:1883" # 내장 MQTT (로컬 용, 선택)
|
|
- "8083:8083" # MQTT WebSocket (선택)
|
|
environment:
|
|
# ─── 핵심 ─────────────────────────────────────────
|
|
- NODE_ENV=production
|
|
- PORT=8080
|
|
|
|
# ─── DB 연결 (IDC 원격 또는 로컬 Postgres) ──────────
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
|
|
# ─── 보안 ─────────────────────────────────────────
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
- PASSWORD_ENCRYPTION_KEY=${PASSWORD_ENCRYPTION_KEY}
|
|
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
|
|
|
|
# ─── 장비 수집기 자동 시작 ────────────────────────
|
|
# 엣지에선 반드시 true — 부팅 시 DB의 모든 활성 연결 폴링 시작
|
|
- ENABLE_AUTO_COLLECTOR=true
|
|
|
|
# ─── 회사/엣지 식별 ──────────────────────────────
|
|
- COMPANY_CODE=${COMPANY_CODE:-spifox}
|
|
- EDGE_ID=${EDGE_ID}
|
|
|
|
volumes:
|
|
# 영속 데이터 (업로드, 로그 등)
|
|
- pipeline-data:/app/storage
|
|
- pipeline-uploads:/app/uploads
|
|
networks:
|
|
- pipeline-network
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -sf http://localhost:8080/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# ─── 프론트엔드 (선택) ──────────────────────────────
|
|
# 엣지에서 직접 UI 접근하고 싶으면 켜기. 보통은 중앙 Pipeline UI 사용.
|
|
pipeline-front:
|
|
image: ${PIPELINE_FRONT_IMAGE:-harbor.wace.me/vexplor_fleet/pipeline-front:latest}
|
|
container_name: pipeline-front
|
|
restart: always
|
|
ports:
|
|
- "9771:3000"
|
|
environment:
|
|
- NEXT_PUBLIC_API_URL=http://localhost:8080/api
|
|
- SERVER_API_URL=http://pipeline-backend:8080
|
|
- NODE_OPTIONS=--max-old-space-size=2048
|
|
networks:
|
|
- pipeline-network
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
|
profiles: ["with-ui"] # docker compose --profile with-ui up 로 선택 기동
|
|
|
|
# ─── Watchtower (자동 업데이트) ──────────────────────
|
|
# 기존 스피폭스 엣지와 동일한 패턴: Harbor 폴링 + 라벨 기반
|
|
watchtower:
|
|
image: nickfedor/watchtower:latest
|
|
container_name: watchtower
|
|
restart: always
|
|
environment:
|
|
- WATCHTOWER_POLL_INTERVAL=300
|
|
- WATCHTOWER_CLEANUP=true
|
|
- WATCHTOWER_LABEL_ENABLE=true
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ~/.docker/config.json:/config.json:ro
|
|
command: --interval 300
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=false"
|
|
profiles: ["watchtower"]
|
|
|
|
networks:
|
|
pipeline-network:
|
|
driver: bridge
|
|
name: pipeline-network
|
|
|
|
volumes:
|
|
pipeline-data:
|
|
name: pipeline-data
|
|
pipeline-uploads:
|
|
name: pipeline-uploads
|