-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
154 lines (146 loc) · 4.51 KB
/
docker-compose.yml
File metadata and controls
154 lines (146 loc) · 4.51 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
version: '3.8'
services:
# ==========================================================================
# PostgreSQL Database
# ==========================================================================
postgres:
image: postgres:15-alpine
container_name: lazycache-postgres
environment:
POSTGRES_USER: lazycache
POSTGRES_PASSWORD: lazycache_dev_password
POSTGRES_DB: lazycache
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lazycache -d lazycache"]
interval: 5s
timeout: 5s
retries: 5
networks:
- lazycache-network
# ==========================================================================
# Redis (Shared Pool Simulation)
# ==========================================================================
redis:
image: redis:7-alpine
container_name: lazycache-redis
command: redis-server --requirepass lazycache_redis_password --appendonly yes
ports:
- "6380:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "lazycache_redis_password", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- lazycache-network
# ==========================================================================
# MinIO (S3 Compatible Storage)
# ==========================================================================
minio:
image: minio/minio:latest
container_name: lazycache-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: lazycache
MINIO_ROOT_PASSWORD: lazycache_minio_password
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- lazycache-network
# ==========================================================================
# Mailhog (Email Testing)
# ==========================================================================
mailhog:
image: mailhog/mailhog:latest
container_name: lazycache-mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
networks:
- lazycache-network
# ==========================================================================
# API Service (Go)
# ==========================================================================
api:
build:
context: ./services/api
dockerfile: Dockerfile
container_name: lazycache-api
environment:
- ENV=development
- PORT=8080
- DATABASE_URL=postgres://lazycache:lazycache_dev_password@postgres:5432/lazycache?sslmode=disable
- REDIS_URL=redis://:lazycache_redis_password@redis:6379/0
- JWT_SECRET=dev-jwt-secret-key-for-local-testing-min-32-chars
- JWT_ACCESS_DURATION=15m
- JWT_REFRESH_DURATION=168h
- SMTP_HOST=mailhog
- SMTP_PORT=1025
- AWS_ENDPOINT=http://minio:9000
- AWS_ACCESS_KEY_ID=lazycache
- AWS_SECRET_ACCESS_KEY=lazycache_minio_password
- AWS_REGION=us-east-1
- S3_BUCKET=lazycache-backups
- ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001,http://localhost:3002,http://localhost:5173
- RATE_LIMIT_REQUESTS=100
- RATE_LIMIT_WINDOW=1m
- AUTH_RATE_LIMIT_REQUESTS=10
- AUTH_RATE_LIMIT_WINDOW=1m
- FREE_TIER_MAX_DATABASES=3
- FREE_TIER_MAX_STORAGE=268435456
- FREE_TIER_MAX_COMMANDS=500000
- BCRYPT_COST=10
- MIN_PASSWORD_LENGTH=8
ports:
- "8088:8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- lazycache-network
profiles:
- full
# ==========================================================================
# Dashboard (React)
# ==========================================================================
dashboard:
build:
context: ./services/dashboard
dockerfile: Dockerfile.dev
container_name: lazycache-dashboard
environment:
- VITE_API_URL=http://localhost:8088/v1
ports:
- "3000:3000"
volumes:
- ./services/dashboard/src:/app/src:ro
depends_on:
- api
networks:
- lazycache-network
profiles:
- full
volumes:
postgres_data:
redis_data:
minio_data:
networks:
lazycache-network:
driver: bridge