Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (76 loc) · 2.68 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (76 loc) · 2.68 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
services:
backend:
build: ./backend
ports:
- "5000:5000"
environment:
# Set this to your server's domain or public IP when deploying live.
# Left as "localhost" for local development.
- PUBLIC_HOST=${PUBLIC_HOST:-localhost}
volumes:
# Gives the backend permission to create/destroy lab containers on
# demand. See the security note at the top of backend/orchestrator.py
# before exposing this backend publicly without a reverse proxy.
- /var/run/docker.sock:/var/run/docker.sock
# Persists solved-lab progress across backend restarts/rebuilds —
# without this, progress.db would live inside the container and
# reset every time the container is recreated.
- progress_data:/data
networks:
- labnet
- labs-internal
# Serves the catalog page over real HTTP instead of a local file://
# path — makes the "one command to start" experience possible, and
# avoids browser quirks that file:// pages have with cookies/storage.
frontend:
image: nginx:alpine
volumes:
- ./frontend:/usr/share/nginx/html:ro
ports:
- "8080:80"
networks:
- labnet
# This service is built (so the image exists) but NOT started by
# `docker compose up` — the backend starts fresh copies of it on demand,
# one per visitor, via orchestrator.py. The "profiles" line is what
# keeps it from auto-starting.
lab-sqli-login:
build: ./labs/lab-sqli-login
image: lab-sqli-login:latest
profiles: ["build-only"]
networks:
- labs-internal
lab-sqli-union:
build: ./labs/lab-sqli-union
image: lab-sqli-union:latest
profiles: ["build-only"]
networks:
- labs-internal
lab-sqli-numeric:
build: ./labs/lab-sqli-numeric
image: lab-sqli-numeric:latest
profiles: ["build-only"]
networks:
- labs-internal
lab-sqli-blind:
build: ./labs/lab-sqli-blind
image: lab-sqli-blind:latest
profiles: ["build-only"]
networks:
- labs-internal
networks:
labnet:
driver: bridge
labs-internal:
name: labs-internal
driver: bridge
# NOTE: we are NOT using "internal: true" here, even though that's
# normally what you'd want for isolation — Docker does not allow
# publishing ports (so browsers can reach a container) on internal
# networks. Isolation for these containers instead comes from the
# per-container memory/CPU/process caps in orchestrator.py, and from
# the fact that nothing else of value is reachable on this network.
# A stronger setup (host-level firewall rules blocking egress from
# this subnet) is a good next hardening step before wide public use.
volumes:
progress_data: