-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
175 lines (157 loc) · 4.78 KB
/
docker-compose.yml
File metadata and controls
175 lines (157 loc) · 4.78 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: '3.9'
# DailyDevQ 백엔드 전용 Docker Compose
# 프론트엔드는 dailydevq-app 레포에서 별도 관리
services:
# PostgreSQL 데이터베이스
postgres:
image: postgres:16-alpine
container_name: dailydevq-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-dailydevq}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-dailydevq123}
POSTGRES_DB: ${POSTGRES_DB:-dailydevq}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dailydevq}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dailydevq-network
# Redis 캐시
redis:
image: redis:7-alpine
container_name: dailydevq-redis
command: redis-server --requirepass ${REDIS_PASSWORD:-redis123}
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dailydevq-network
# DynamoDB Local (AWS 개발용)
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dailydevq-dynamodb
command: "-jar DynamoDBLocal.jar -sharedDb -inMemory"
ports:
- "${DYNAMODB_PORT:-8000}:8000"
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:8000 | grep -q 'MissingAuthenticationToken' || exit 1"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dailydevq-network
# LocalStack (AWS 서비스 에뮬레이션)
localstack:
image: localstack/localstack:latest
container_name: dailydevq-localstack
environment:
SERVICES: s3,ses,secretsmanager,ssm
DEBUG: ${LOCALSTACK_DEBUG:-0}
DATA_DIR: /var/lib/localstack
AWS_DEFAULT_REGION: ${AWS_REGION:-ap-northeast-2}
ports:
- "${LOCALSTACK_PORT:-14566}:4566"
volumes:
- localstack_data:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4566/_localstack/health"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dailydevq-network
# FastAPI 백엔드
backend:
build:
context: .
dockerfile: Dockerfile.dev
container_name: dailydevq-backend
environment:
# 데이터베이스 설정
DATABASE_URL: postgresql://${POSTGRES_USER:-dailydevq}:${POSTGRES_PASSWORD:-dailydevq123}@postgres:5432/${POSTGRES_DB:-dailydevq}
# Redis 설정
REDIS_URL: redis://:${REDIS_PASSWORD:-redis123}@redis:6379/0
# AWS 설정 (LocalStack)
AWS_REGION: ${AWS_REGION:-ap-northeast-2}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-test}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-test}
AWS_ENDPOINT_URL: http://localstack:4566 # Internal docker network uses 4566
# DynamoDB 설정
DYNAMODB_ENDPOINT: http://dynamodb-local:8000
DYNAMODB_TABLE_PREFIX: ${DYNAMODB_TABLE_PREFIX:-dailydevq-dev}
# S3 설정
S3_BUCKET_NAME: ${S3_BUCKET_NAME:-dailydevq-dev-bucket}
S3_ENDPOINT: http://localstack:4566 # Internal docker network uses 4566
# 애플리케이션 설정
DEBUG: ${DEBUG:-true}
LOG_LEVEL: ${LOG_LEVEL:-DEBUG}
ENABLE_SWAGGER: ${ENABLE_SWAGGER:-true}
# JWT 설정
JWT_SECRET: ${JWT_SECRET:-dev-secret-key-change-in-production}
JWT_ALGORITHM: HS256
JWT_EXPIRE_HOURS: 24
# CORS 설정 (프론트엔드 허용)
CORS_ORIGINS: http://localhost:3000,http://frontend:3000
# OpenAI 설정
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
# Anthropic 설정
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
ports:
- "${BACKEND_PORT:-8001}:8000"
volumes:
- .:/app
- backend_venv:/app/.venv
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
dynamodb-local:
condition: service_healthy
localstack:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- dailydevq-network
restart: unless-stopped
# MailHog (개발용 메일 서버)
mailhog:
image: mailhog/mailhog:latest
container_name: dailydevq-mailhog
ports:
- "${MAILHOG_SMTP_PORT:-1025}:1025" # SMTP
- "${MAILHOG_WEB_PORT:-8025}:8025" # Web UI
networks:
- dailydevq-network
volumes:
postgres_data:
driver: local
redis_data:
driver: local
dynamodb_data:
driver: local
localstack_data:
driver: local
backend_venv:
driver: local
networks:
dailydevq-network:
name: dailydevq-shared
driver: bridge