#!/bin/bash

# Event Service Docker 실행 스크립트
# 실제 환경에 맞게 환경변수 값을 수정하세요

docker run -d \
  --name event-service \
  -p 8082:8082 \
  --restart unless-stopped \
  \
  # 서버 설정
  -e SERVER_PORT=8082 \
  \
  # PostgreSQL 설정 (필수)
  -e DB_HOST=your-postgresql-host \
  -e DB_PORT=5432 \
  -e DB_NAME=eventdb \
  -e DB_USERNAME=eventuser \
  -e DB_PASSWORD=your-db-password \
  -e DDL_AUTO=update \
  \
  # Redis 설정 (필수)
  -e REDIS_HOST=your-redis-host \
  -e REDIS_PORT=6379 \
  -e REDIS_PASSWORD=your-redis-password \
  \
  # Kafka 설정 (필수)
  -e KAFKA_BOOTSTRAP_SERVERS=your-kafka-host:9092 \
  \
  # JWT 설정 (필수 - 최소 32자)
  -e JWT_SECRET=your-jwt-secret-key-minimum-32-characters-required \
  \
  # 마이크로서비스 연동 (선택)
  -e CONTENT_SERVICE_URL=http://content-service:8083 \
  -e DISTRIBUTION_SERVICE_URL=http://distribution-service:8086 \
  \
  # 로깅 설정 (선택)
  -e LOG_LEVEL=INFO \
  -e SQL_LOG_LEVEL=WARN \
  \
  # 이미지
  acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service:latest

echo "Event Service 컨테이너 시작됨"
echo "헬스체크: curl http://localhost:8082/actuator/health"
echo "로그 확인: docker logs -f event-service"
