-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (87 loc) · 2.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
93 lines (87 loc) · 2.41 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
version: '3.8'
services:
# MongoDB Database - Localhost Only
mongodb:
image: mongo:7.0
environment:
MONGO_INITDB_ROOT_USERNAME: hyperlogic
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: hyperlogic_ai
ports:
- "127.0.0.1:27017:27017" # Localhost only, no internal networking
volumes:
- mongodb_data:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
networks:
- localhost_only
# Python FastAPI Backend - Localhost Only
hyperlogic-ai:
build:
context: ./server
dockerfile: Dockerfile
ports:
- "127.0.0.1:5000:5000" # Localhost only, no internal networking
environment:
- NODE_ENV=production
- PORT=5000
- MONGODB_URL=mongodb://hyperlogic:password@127.0.0.1:27017/hyperlogic_ai?authSource=admin
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- CORS_ORIGIN=http://localhost:3000
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://127.0.0.1:5000/api/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- localhost_only
# React Frontend - Localhost Only
hyperlogic-ai-frontend:
build:
context: ./web
dockerfile: Dockerfile
ports:
- "127.0.0.1:3000:3000" # Localhost only, no internal networking
environment:
- REACT_APP_API_URL=http://127.0.0.1:5000
- REACT_APP_SOCKET_URL=http://127.0.0.1:5000
depends_on:
- hyperlogic-ai
restart: unless-stopped
networks:
- localhost_only
# Optional: Add a reverse proxy - Localhost Only
nginx:
image: nginx:alpine
ports:
- "127.0.0.1:80:80" # Localhost only
- "127.0.0.1:443:443" # Localhost only
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- hyperlogic-ai
- hyperlogic-ai-frontend
restart: unless-stopped
networks:
- localhost_only
profiles:
- production
# Localhost-only network configuration
networks:
localhost_only:
driver: bridge
internal: true # No external access
volumes:
mongodb_data: