-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (96 loc) · 2.85 KB
/
docker-compose.yml
File metadata and controls
101 lines (96 loc) · 2.85 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
version: '3.9'
services:
db:
image: postgres:16
restart: always
environment:
POSTGRES_USER: modularitsm
POSTGRES_PASSWORD: modularitsm_dev
POSTGRES_DB: modularitsm
ports:
- "5432:5432" # DEV ONLY — remove or bind to 127.0.0.1 in production
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U modularitsm"]
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 512M
mailhog:
image: mailhog/mailhog
restart: always
ports:
- "1025:1025" # SMTP — DEV ONLY
- "8025:8025" # Web UI — DEV ONLY
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8025"]
interval: 10s
timeout: 5s
retries: 3
deploy:
resources:
limits:
memory: 128M
backend:
build: ./backend
restart: always
ports:
- "8000:8000" # DEV ONLY — in production, only Nginx (port 3000) should be exposed
environment:
DATABASE_URL: postgresql://modularitsm:modularitsm_dev@db:5432/modularitsm
SECRET_KEY: dev_secret_change_in_prod
ENVIRONMENT: development
CORS_ORIGINS: "http://localhost:3000"
# ── SMTP ──────────────────────────────────────────────────
# Config defaults are production-safe (SES, TLS on, port 587).
# For local dev we override to MailHog (no TLS, port 1025).
# In production these lines are REMOVED — the defaults just work.
MAIL_SERVER: mailhog
MAIL_PORT: 1025
MAIL_FROM: [email protected]
MAIL_STARTTLS: "false"
# ── Instance identity ─────────────────────────────────────
INSTANCE_BASE_URL: http://localhost:3000
depends_on:
db:
condition: service_healthy
mailhog:
condition: service_started
volumes:
- ./backend:/app
- uploads_data:/app/uploads
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
interval: 10s
timeout: 5s
retries: 3
deploy:
resources:
limits:
memory: 512M
frontend:
build: ./frontend
restart: always
ports:
- "3000:3000"
volumes:
- ./frontend/index.html:/usr/share/nginx/html/index.html:ro
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- backend
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:3000/"]
interval: 10s
timeout: 5s
retries: 3
deploy:
resources:
limits:
memory: 128M
volumes:
postgres_data:
uploads_data: