about summary refs log tree commit diff
path: root/docker-compose.yml
blob: 4de7409e1682a8316906a5f92224497152d4bb0c (plain)
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
191
192
193
194
195
196
197
198
199
version: '3'
    
services:
    traefik:
        image: "traefik:v2.0"
        container_name: "traefik"
        command:
            - "--api.insecure=true"
            - "--providers.docker=true"
            - "--providers.docker.exposedbydefault=false"
            - "--entrypoints.web.address=:80"
            - "--entrypoints.websecure.address=:443"
            - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
            - "--certificatesresolvers.mytlschallenge.acme.email=your@mail.com"
            - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
            - "--metrics.prometheus=true"
        ports:
            - "80:80"
            - "443:443"
            - "8080:8080"
        volumes:
            - "./letsencrypt:/letsencrypt"
            - "/var/run/docker.sock:/var/run/docker.sock:ro"
            - "./traefik_users:/traefik_users"
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.traefik.entrypoints=web"
            - "traefik.http.routers.traefik.rule=Host(`traefik.${HOSTNAME}`)"
            - "traefik.http.middlewares.traefik-auth.basicauth.usersFile=/traefik_users"
            - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
            - "traefik.http.routers.traefik-secure.entrypoints=websecure"
            - "traefik.http.routers.traefik-secure.rule=Host(`traefik.${HOSTNAME}`)"
            - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
            - "traefik.http.routers.traefik-secure.tls=true"
            - "traefik.http.routers.traefik-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.traefik-secure.service=api@internal"
            - "traefik.http.services.traefik.loadbalancer.server.port=8080"
        networks:
            - circus

    register:
        image: "registry.darknebu.la/circus/register:latest"
        volumes:
            - "/var/run/docker.sock:/var/run/docker.sock:ro"
        ports:
            - "8081:8081"
        environment:
            - HOSTNAME=${HOSTNAME}
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.register.entrypoints=web"
            - "traefik.http.routers.register.rule=Host(`register.${HOSTNAME}`)"
            - "traefik.http.middlewares.register-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.register.middlewares=register-https-redirect"
            - "traefik.http.routers.register-secure.entrypoints=websecure"
            - "traefik.http.routers.register-secure.rule=Host(`register.${HOSTNAME}`)"
            - "traefik.http.routers.register-secure.tls=true"
            - "traefik.http.routers.register-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.register-secure.service=register"
            - "traefik.http.services.register.loadbalancer.server.port=8081"
        networks:
            - circus

    scoreboard:
        image: "registry.darknebu.la/circus/scoreboard:latest"
        container_name: "scoreboard"
        volumes:
            - "/var/run/docker.sock:/var/run/docker.sock:ro"
        ports:
            - "8082:8080"
        environment:
            - HOSTNAME=${HOSTNAME}
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.scoreboard.entrypoints=web"
            - "traefik.http.routers.scoreboard.rule=Host(`scoreboard.${HOSTNAME}`)"
            - "traefik.http.middlewares.scoreboard-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.scoreboard.middlewares=scoreboard-https-redirect"
            - "traefik.http.routers.scoreboard-secure.entrypoints=websecure"
            - "traefik.http.routers.scoreboard-secure.rule=Host(`scoreboard.${HOSTNAME}`)"
            - "traefik.http.routers.scoreboard-secure.tls=true"
            - "traefik.http.routers.scoreboard-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.scoreboard-secure.service=scoreboard"
            - "traefik.http.services.scoreboard.loadbalancer.server.port=8080"
        networks:
            - circus

    prometheus:
        image: "prom/prometheus:latest"
        volumes:
            - "/var/run/docker.sock:/var/run/docker.sock:ro"
        command:
            - "--config.file=/etc/prometheus/prometheus.yml"
        volumes:
            - "./prometheus.yml:/etc/prometheus/prometheus.yml:ro"
            - "prometheus_data:/prometheus"
        ports:
            - "9090:9090"
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.prometheus.entrypoints=web"
            - "traefik.http.routers.prometheus.rule=Host(`prometheus.${HOSTNAME}`)"
            - "traefik.http.middlewares.prometheus-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.prometheus.middlewares=prometheus-https-redirect"
            - "traefik.http.routers.prometheus-secure.entrypoints=websecure"
            - "traefik.http.routers.prometheus-secure.rule=Host(`prometheus.${HOSTNAME}`)"
            - "traefik.http.routers.prometheus-secure.tls=true"
            - "traefik.http.routers.prometheus-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.prometheus-secure.service=prometheus"
            - "traefik.http.services.prometheus.loadbalancer.server.port=9090"
        networks:
            - circus

    grafana:
        image: "grafana/grafana"
        container_name: "grafana"
        volumes:
            - "grafana_data:/var/lib/grafana"
            - "./grafana.ini:/etc/grafana/grafana.ini"
        env_file:
            # grafana.env:
            # GF_SERVER_ROOT_URL=http://grafana.docker.localhost:3000
            # GF_SECURITY_ADMIN_PASSWORD=<grafana admin password>
            - "./grafana.env"
        ports:
            - "3000:3000"
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.grafana.entrypoints=web"
            - "traefik.http.routers.grafana.rule=Host(`grafana.${HOSTNAME}`)"
            - "traefik.http.middlewares.grafana-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.grafana.middlewares=grafana-https-redirect"
            - "traefik.http.routers.grafana-secure.entrypoints=websecure"
            - "traefik.http.routers.grafana-secure.rule=Host(`grafana.${HOSTNAME}`)"
            - "traefik.http.routers.grafana-secure.tls=true"
            - "traefik.http.routers.grafana-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.grafana-secure.service=grafana"
            - "traefik.http.services.grafana.loadbalancer.server.port=3000"
        networks:
            - circus
    landingpage:
        image: "registry.darknebu.la/circus/landingpage:latest"
        container_name: "landingpage"
        environment:
            - HOSTNAME=${HOSTNAME}
            - CTFNAME=${CTFNAME}
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.landingpage.entrypoints=web"
            - "traefik.http.routers.landingpage.rule=Host(`${HOSTNAME}`)"
            - "traefik.http.middlewares.landingpage-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.landingpage.middlewares=landingpage-https-redirect"
            - "traefik.http.routers.landingpage-secure.entrypoints=websecure"
            - "traefik.http.routers.landingpage-secure.rule=Host(`${HOSTNAME}`)"
            - "traefik.http.routers.landingpage-secure.tls=true"
            - "traefik.http.routers.landingpage-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.landingpage-secure.service=landingpage"
            - "traefik.http.services.landingpage.loadbalancer.server.port=8081"
        networks:
            - circus

    manager:
        image: "registry.darknebu.la/circus/manager:latest"
        container_name: "manager"
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.manager.entrypoints=web"
            - "traefik.http.routers.manager.rule=Host(`manager.${HOSTNAME}`)"
            - "traefik.http.middlewares.manager-https-redirect.redirectscheme.scheme=https"
            - "traefik.http.routers.manager.middlewares=manager-https-redirect"
            - "traefik.http.routers.manager-secure.entrypoints=websecure"
            - "traefik.http.routers.manager-secure.rule=Host(`manager.${HOSTNAME}`)"
            - "traefik.http.routers.manager-secure.tls=true"
            - "traefik.http.routers.manager-secure.tls.certresolver=mytlschallenge"
            - "traefik.http.routers.manager-secure.service=manager"
            - "traefik.http.services.manager.loadbalancer.server.port=8080"
        networks:
            - circus
            - circus_db

    postgresql:
        image: "postgres:12.0"
        container_name: "postgresql"
        volumes:
            - "circus_data:/var/lib/postgresql/data"
        networks:
            - circus_db

networks:
    circus:
        external:
            name: circus
    circus_db:

volumes:
    prometheus_data: {}
    grafana_data: {}
    circus_data: {}