-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (102 loc) · 2.58 KB
/
docker-compose.yml
File metadata and controls
109 lines (102 loc) · 2.58 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:7.0
container_name: ai-ide-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
MONGO_INITDB_DATABASE: ai-ide
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- ./infra/mongodb/init-scripts:/docker-entrypoint-initdb.d
networks:
- ai-ide-network
# Redis for Session Storage and Caching
redis:
image: redis:7-alpine
container_name: ai-ide-redis
restart: unless-stopped
command: redis-server --appendonly yes --requirepass redis123
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- ai-ide-network
# Backend API Server
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: ai-ide-backend
restart: unless-stopped
environment:
NODE_ENV: development
PORT: 3001
MONGODB_URI: mongodb://admin:password123@mongodb:27017/ai-ide?authSource=admin
REDIS_URL: redis://:redis123@redis:6379
JWT_SECRET: dev-jwt-secret-change-in-production
CORS_ORIGINS: http://localhost:3000
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
GOOGLE_REDIRECT_URI: http://localhost:3001/api/v1/auth/google/callback
ports:
- "3001:3001"
volumes:
- ./backend:/app
- /app/node_modules
- /var/run/docker.sock:/var/run/docker.sock # For Docker container management
depends_on:
- mongodb
- redis
networks:
- ai-ide-network
# Frontend Development Server
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: ai-ide-frontend
restart: unless-stopped
environment:
NODE_ENV: development
VITE_API_URL: http://localhost:3001/api/v1
VITE_WS_URL: ws://localhost:3001
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
networks:
- ai-ide-network
# Nginx Reverse Proxy (Optional for production-like setup)
nginx:
image: nginx:alpine
container_name: ai-ide-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./infra/nginx/ssl:/etc/nginx/ssl
depends_on:
- frontend
- backend
networks:
- ai-ide-network
profiles:
- production
volumes:
mongodb_data:
redis_data:
networks:
ai-ide-network:
driver: bridge