Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
58 lines (54 loc) · 2.05 KB
/
Copy pathcompose.yml
File metadata and controls
58 lines (54 loc) · 2.05 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
services:
# ── Redis ────────────────────────────────────────────────────────────────────
# Stores all queue state: session hashes, queue list, active set,
# capacity counter, and admission timing history.
redis:
image: redis:7-alpine
container_name: queue-redis
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
networks:
- queue-net
# ── Queue Service (Go) ───────────────────────────────────────────────────────
# Handles all user-facing traffic: session gating, queue page, admin APIs,
# and reverse proxying admitted users to the target service.
queue-service:
build:
context: ./queue-service
dockerfile: Dockerfile
container_name: queue-service
restart: unless-stopped
ports:
- "80:8080"
environment:
REDIS_ADDR: redis:6379
TARGET_URL: http://target:80
QUEUE_CAPACITY: "3"
COOKIE_SECRET: "change-me-in-production-32-chars!!"
PORT: "8080"
WEB_DIR: "/web"
depends_on:
redis:
condition: service_healthy
networks:
- queue-net
# ── Target (Nginx) ───────────────────────────────────────────────────────────
# Serves the protected page. No published ports — only reachable from
# queue-service over the internal network. Direct browser access is
# architecturally impossible without going through the queue.
target:
build:
context: ./target
dockerfile: Dockerfile
container_name: queue-target
restart: unless-stopped
# intentionally no "ports:" block — internal access only
networks:
- queue-net
networks:
queue-net:
name: queue-net