-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackend.env.example
More file actions
102 lines (85 loc) · 3.4 KB
/
backend.env.example
File metadata and controls
102 lines (85 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# ===========================================
# SpeedCam Backend Environment Variables
# ===========================================
# 사용법: 이 파일을 backend.env로 복사하여 사용
# cp backend.env.example backend.env
# ===========================================
# Django 설정
# ===========================================
SECRET_KEY=your-django-secret-key-here
DJANGO_SETTINGS_MODULE=config.settings.dev
DEBUG=True
# ===========================================
# 데이터베이스 설정 (MySQL - MSA)
# ===========================================
# 공통 연결 정보
DB_HOST=mysql
DB_PORT=3306
DB_USER=sa
DB_PASSWORD=1234
# MSA - 서비스별 독립 데이터베이스
DB_NAME=speedcam
DB_NAME_VEHICLES=speedcam_vehicles
DB_NAME_DETECTIONS=speedcam_detections
DB_NAME_NOTIFICATIONS=speedcam_notifications
# ===========================================
# RabbitMQ / Celery 설정
# ===========================================
CELERY_BROKER_URL=amqp://sa:1234@rabbitmq:5672//
RABBITMQ_HOST=rabbitmq
# MQTT 설정 (RabbitMQ MQTT Plugin)
MQTT_PORT=1883
MQTT_USER=sa
MQTT_PASS=1234
# ===========================================
# GCS (Google Cloud Storage) 인증
# ===========================================
# GCS는 ADC (Application Default Credentials) 사용
# GCE 인스턴스: 메타데이터 서버에서 자동 인증 (설정 불필요)
# 로컬 개발: gcloud auth application-default login 실행 후 사용
# OCR_MOCK=true이면 GCS 호출 없으므로 인증 불필요
# ===========================================
# Firebase 설정 (FCM Push Notification)
# ===========================================
FIREBASE_CREDENTIALS=/app/credentials/firebase-service-account.json
# ===========================================
# Celery Worker 설정
# ===========================================
# OCR Worker (CPU 집약적 - prefork pool)
OCR_CONCURRENCY=2
# Alert Worker (I/O 집약적 - gevent pool)
ALERT_CONCURRENCY=50
# ===========================================
# Mock 설정 (로컬 개발용)
# ===========================================
# true: 실제 GCS/FCM 호출 없이 Mock 응답 반환
# false: 실제 서비스 호출 (credentials 필요)
OCR_MOCK=true
FCM_MOCK=true
# ===========================================
# Gunicorn 설정
# ===========================================
GUNICORN_WORKERS=4
GUNICORN_THREADS=2
# ===========================================
# 로깅 설정
# ===========================================
LOG_LEVEL=info
# ===========================================
# CORS 설정
# ===========================================
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
# ===========================================
# OpenTelemetry 설정
# ===========================================
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_RESOURCE_ATTRIBUTES=service.namespace=speedcam,deployment.environment=dev
# Valid values: always_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off, parentbased_traceidratio
OTEL_TRACES_SAMPLER=parentbased_always_on
OTEL_PYTHON_LOG_CORRELATION=true
# gevent monkey-patching 순서 교정 (Alert Worker: Celery gevent pool + OTel)
# docs/GEVENT_DB_THREAD_SAFETY.md 참조
OTEL_PYTHON_AUTO_INSTRUMENTATION_EXPERIMENTAL_GEVENT_PATCH=patch_all
# GCP metadata 내부 요청을 트레이싱에서 제외 (404 ERROR span 방지)
OTEL_PYTHON_REQUESTS_EXCLUDED_URLS=metadata.google.internal