Repository navigation
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
190 lines (170 loc) · 5.76 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
190 lines (170 loc) · 5.76 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# TinyRSVP Test Environment
# Complete stack with mock SMTP, OIDC, and reverse proxy for testing
# Usage: docker-compose -f docker-compose.test.yml up
#
# ⚠️ SAFE TO COMMIT - TEST ENVIRONMENT ONLY
# All secrets in this file are intentionally public and only work locally.
# See test/SECURITY_NOTICE.md for details.
services:
# ============================================================================
# TinyRSVP Application
# ============================================================================
tinyrsvp:
build:
context: .
dockerfile: Dockerfile
container_name: tinyrsvp-tinyrsvp
ports:
- "8080:8080"
environment:
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8080
- SERVER_BASE_URL=http://localhost:8080
- DATABASE_TYPE=sqlite
- DATABASE_PATH=/data/tinyrsvp.db
# Token Secret (REQUIRED - must persist across restarts)
- TOKEN_SECRET=da8f152a3cc3d58054cb988a463344503ad1ad09fba718a8a5e6e9513d16040f
# SMTP Configuration (MailHog)
- SMTP_HOST=mailhog
- SMTP_PORT=1025
- SMTP_USERNAME=
- SMTP_PASSWORD=
- SMTP_TLS=false
- EMAIL_FROM=noreply@tinyrsvp.test
- EMAIL_FROM_NAME=TinyRSVP Test
# Forward Auth Configuration (simpler for testing)
- AUTH_MODE=forward_auth
- OIDC_ENABLED=false
- FORWARD_AUTH_ENABLED=true
- FORWARD_AUTH_USER_HEADER=X-Forwarded-User
- FORWARD_AUTH_EMAIL_HEADER=X-Forwarded-Email
# Trust any Docker bridge network — CIDR supported as of fix 2026-04-07
- FORWARD_AUTH_TRUSTED_IPS=127.0.0.1,::1,172.16.0.0/12
# Storage
- STORAGE_TYPE=local
- STORAGE_LOCAL_PATH=/data/uploads
# Development/Testing
- LOG_LEVEL=debug
- ENVIRONMENT=test
volumes:
- tinyrsvp-test-data:/data
networks:
- tinyrsvp-test
depends_on:
- mailhog
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
# ============================================================================
# MailHog - Mock SMTP Server with Web UI
# ============================================================================
mailhog:
image: mailhog/mailhog:latest
container_name: mailhog-test
ports:
- "8025:8025" # Web UI
- "1025:1025" # SMTP
networks:
- tinyrsvp-test
environment:
- MH_STORAGE=memory
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8025"]
interval: 10s
timeout: 3s
retries: 3
# ============================================================================
# Authelia - Lightweight OIDC Provider
# ============================================================================
authelia:
image: authelia/authelia:latest
container_name: authelia-test
ports:
- "9091:9091" # Authelia web UI
environment:
- TZ=America/Los_Angeles
volumes:
- ./test/authelia/configuration.yml:/config/configuration.yml:ro
- ./test/authelia/users_database.yml:/config/users_database.yml:ro
- ./test/authelia/certs:/config/certs:ro
- authelia-data:/config
networks:
- tinyrsvp-test
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9091/api/health"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
# ============================================================================
# Traefik - Reverse Proxy (Optional, for advanced testing)
# ============================================================================
traefik:
image: traefik:v3.7
container_name: traefik-test
command:
- --api.insecure=true
- --providers.file.directory=/etc/traefik/dynamic
- --providers.file.watch=true
- --entrypoints.web.address=:80
- --log.level=DEBUG
ports:
- "8081:80" # HTTP with basic auth
- "8082:8080" # Traefik dashboard
volumes:
- ./test/traefik/dynamic.yml:/etc/traefik/dynamic/dynamic.yml:ro
networks:
- tinyrsvp-test
depends_on:
- tinyrsvp
labels:
- "traefik.enable=true"
# ============================================================================
# Browserless - Headless Chrome for Browser Testing
# ============================================================================
browserless:
image: browserless/chrome:latest
container_name: browserless-chrome
ports:
- "3000:3000" # Browserless HTTP API
- "9222:9222" # Chrome Remote Debugging Protocol
environment:
# Enable remote debugging
- DEBUG=browserless*
- ENABLE_DEBUGGER=true
- CHROME_REFRESH_TIME=0
# Connection settings
- CONNECTION_TIMEOUT=60000
- MAX_CONCURRENT_SESSIONS=10
- QUEUE_LENGTH=10
# Chrome flags for remote debugging
- PREBOOT_CHROME=true
- KEEP_ALIVE=true
- DEFAULT_LAUNCH_ARGS=["--remote-debugging-address=0.0.0.0","--remote-debugging-port=9222","--no-sandbox","--disable-setuid-sandbox","--disable-dev-shm-usage","--disable-gpu"]
# Security (adjust for your needs)
- TOKEN=
- CORS=true
# Resource limits
- MAX_CPU_PERCENT=99
- MAX_MEMORY_PERCENT=99
shm_size: 2gb
networks:
- tinyrsvp-test
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/pressure"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
restart: unless-stopped
networks:
tinyrsvp-test:
driver: bridge
volumes:
tinyrsvp-test-data:
driver: local
authelia-data:
driver: local