-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (102 loc) · 2.82 KB
/
docker-compose.yml
File metadata and controls
108 lines (102 loc) · 2.82 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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: marketai-app
ports:
- "8080:8080"
environment:
- PORT=${PORT:-8080}
- ENV=${ENV:-development}
- DB_HOST=postgres
- DB_PORT=5432
- DB_USER=${DB_USER:-marketai}
- DB_PASSWORD=${DB_PASSWORD:-marketai123}
- DB_NAME=${DB_NAME:-marketai_dev}
- DB_SSLMODE=disable
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- REDIS_DB=${REDIS_DB:-0}
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
postgres:
image: postgres:15-alpine
container_name: marketai-postgres
environment:
POSTGRES_USER: ${DB_USER:-marketai}
POSTGRES_PASSWORD: ${DB_PASSWORD:-marketai123}
POSTGRES_DB: ${DB_NAME:-marketai_dev}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-marketai}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: marketai-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Prometheus ve Grafana sadece production'da gerekli
# Local development için opsiyonel - gerekirse uncomment edin
# prometheus:
# image: prom/prometheus:latest
# container_name: marketai-prometheus
# ports:
# - "9090:9090"
# volumes:
# - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
# - prometheus_data:/prometheus
# command:
# - '--config.file=/etc/prometheus/prometheus.yml'
# - '--storage.tsdb.path=/prometheus'
# restart: unless-stopped
# grafana:
# image: grafana/grafana:latest
# container_name: marketai-grafana
# ports:
# - "3000:3000"
# environment:
# - GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
# - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
# - GF_USERS_ALLOW_SIGN_UP=false
# volumes:
# - grafana_data:/var/lib/grafana
# - ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
# - ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
# depends_on:
# - prometheus
# restart: unless-stopped
volumes:
postgres_data:
redis_data:
# prometheus_data:
# grafana_data: