-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
176 lines (171 loc) · 4.6 KB
/
Copy pathdocker-compose.yml
File metadata and controls
176 lines (171 loc) · 4.6 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
services:
# PostgreSQL Database
db:
image: postgres:16-alpine
container_name: isms-db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-little_isms}
POSTGRES_USER: ${POSTGRES_USER:-isms_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-isms_password}
ports:
# ✅ Security: Port nur auf localhost verfügbar
- "127.0.0.1:${DB_PORT:-5432}:5432"
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-isms_user} -d ${POSTGRES_DB:-little_isms}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- isms-network
# Security: Resource Limits
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Little ISMS Helper Application
app:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: isms-app
restart: unless-stopped
depends_on:
db:
condition: service_healthy
mailhog:
condition: service_started
ports:
- "${APP_PORT:-8000}:80"
- "${APP_PORT_HTTPS:-8443}:443"
volumes:
# Named volumes for cache and logs
- var_cache:/var/www/html/var/cache
- var_log:/var/www/html/var/log
environment:
# Note: APP_SECRET und DATABASE_URL werden vom Deployment Wizard konfiguriert
APP_ENV: ${APP_ENV:-prod}
APP_DEBUG: ${APP_DEBUG:-0}
# External-DB mode — skip embedded MariaDB bootstrap in init-mysql.sh
EMBEDDED_DB: none
DATABASE_URL: "postgresql://${POSTGRES_USER:-isms_user}:${POSTGRES_PASSWORD:-isms_password}@db:5432/${POSTGRES_DB:-little_isms}?serverVersion=16&charset=utf8"
# MailHog für Email-Testing
MAILER_DSN: smtp://mailhog:1025
networks:
- isms-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/de/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 300s
# Security: Resource Limits
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# MailHog - Email Testing
mailhog:
image: mailhog/mailhog:latest
container_name: isms-mailhog
restart: unless-stopped
ports:
- "127.0.0.1:${MAILHOG_SMTP_PORT:-1025}:1025" # SMTP port
- "127.0.0.1:${MAILHOG_WEB_PORT:-8025}:8025" # Web UI port
networks:
- isms-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8025/api/v1/events"]
interval: 30s
timeout: 5s
retries: 3
# Security: Resource Limits
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# pgAdmin - Database Management (Optional - nur für Development!)
pgadmin:
image: dpage/pgadmin4:latest
container_name: isms-pgadmin
restart: unless-stopped
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@example.com}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
ports:
# ✅ Security: Port nur auf localhost verfügbar
- "127.0.0.1:${PGADMIN_PORT:-5050}:80"
volumes:
- pgadmin_data:/var/lib/pgadmin
networks:
- isms-network
depends_on:
- db
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/misc/ping"]
interval: 30s
timeout: 5s
retries: 3
# Security: Resource Limits
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
# ✅ Alle Volumes sind persistent - überleben docker-compose down und Reboot!
db_data:
driver: local
var_cache:
driver: local
var_log:
driver: local
pgadmin_data:
driver: local
networks:
isms-network:
driver: bridge