-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (91 loc) · 2.24 KB
/
docker-compose.yml
File metadata and controls
97 lines (91 loc) · 2.24 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:6.0
container_name: justcode-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_DATABASE: justcoding
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
networks:
- justcode-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/justcoding --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 40s
# Backend Server
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: justcode-server
restart: unless-stopped
ports:
- "4334:4334"
environment:
- NODE_ENV=production
- PORT=4334
- MONGODB_URI=mongodb://mongodb:27017/justcoding
- FRONTEND_URL=http://localhost:5173
# Add your API keys here or use .env file
# - OPENAI_API_KEY=${OPENAI_API_KEY}
depends_on:
mongodb:
condition: service_healthy
networks:
- justcode-network
volumes:
# Mount source code for development (comment out for production)
- ./server:/app
- /app/node_modules
# For production, comment out the volume mounts above
# Frontend Client (Development)
client-dev:
build:
context: ./client
dockerfile: Dockerfile.dev
container_name: justcode-client-dev
restart: unless-stopped
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:4334
depends_on:
- server
networks:
- justcode-network
volumes:
# Mount source code for hot-reloading
- ./client:/app
- /app/node_modules
stdin_open: true
tty: true
# Frontend Client (Production) - uncomment for production deployment
# client-prod:
# build:
# context: ./client
# dockerfile: Dockerfile
# container_name: justcode-client-prod
# restart: unless-stopped
# ports:
# - "80:80"
# depends_on:
# - server
# networks:
# - justcode-network
networks:
justcode-network:
driver: bridge
name: justcode-network
volumes:
mongodb_data:
name: justcode-mongodb-data
mongodb_config:
name: justcode-mongodb-config