-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (95 loc) · 2.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
99 lines (95 loc) · 2.84 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
services:
mongodb:
image: mongo:7.0
container_name: soceng_mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME:-soceng_admin}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-soceng_secure_password_2025}
MONGO_INITDB_DATABASE: ${DB_NAME:-Pretexta}
volumes:
- mongodb_data:/data/db
- ./docker/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
ports:
- "${MONGO_PORT:-47017}:27017"
networks:
- soceng_network
dns:
- 8.8.8.8
- 8.8.4.4
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
backend:
build:
context: .
dockerfile: Dockerfile.backend
network: host
container_name: soceng_backend
restart: unless-stopped
environment:
MONGO_URL: mongodb://${MONGO_USERNAME:-soceng_admin}:${MONGO_PASSWORD:-soceng_secure_password_2025}@mongodb:27017/${DB_NAME:-Pretexta}?authSource=admin
DB_NAME: ${DB_NAME:-Pretexta}
JWT_SECRET: ${JWT_SECRET:-change-this-secret-key-in-production}
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:${FRONTEND_PORT:-9443},http://localhost:80,http://localhost:3000}
# Seed admin credentials — change before production deployment
SEED_ADMIN_USERNAME: ${SEED_ADMIN_USERNAME:-soceng}
SEED_ADMIN_PASSWORD: ${SEED_ADMIN_PASSWORD:-Cialdini@2025!}
SEED_ADMIN_DISPLAY_NAME: ${SEED_ADMIN_DISPLAY_NAME:-Admin}
volumes:
- ./backend:/app
- ./data:/app/data
- ./bin:/app/bin
ports:
- "${BACKEND_PORT:-9442}:8001"
depends_on:
mongodb:
condition: service_healthy
networks:
- soceng_network
dns:
- 8.8.8.8
- 8.8.4.4
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/api/health')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
command: uvicorn server:app --host 0.0.0.0 --port 8001 --reload
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
network: host
args:
REACT_APP_BACKEND_URL: ${REACT_APP_BACKEND_URL:-http://localhost:9442}
container_name: soceng_frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-9443}:3000"
depends_on:
backend:
condition: service_healthy
networks:
- soceng_network
dns:
- 8.8.8.8
- 8.8.4.4
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
mongodb_data:
driver: local
networks:
soceng_network:
driver: bridge
driver_opts:
com.docker.network.bridge.name: pretexta0