Skip to content

Commit eedb7be

Browse files
authored
Add segmented compose (#132)
* compose * consistency * UTC
1 parent 7bd95ba commit eedb7be

File tree

4 files changed

+134
-0
lines changed

4 files changed

+134
-0
lines changed

docker-compose-segmented/core/.env

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## General Core configuration ##
2+
DEFGUARD_AUTH_SECRET=<64_CHAR_RANDOM_SECRET>
3+
DEFGUARD_YUBIBRIDGE_SECRET=<64_CHAR_RANDOM_SECRET>
4+
DEFGUARD_GATEWAY_SECRET=<64_CHAR_RANDOM_SECRET>
5+
DEFGUARD_SECRET_KEY=<64_CHAR_RANDOM_SECRET>
6+
DEFGUARD_URL=<YOUR_DEFGUARD_CORE_URL>
7+
# DEFGUARD_WEBAUTHN_RP_ID=<YOUR_DEFGUARD_WEBAUTHN_RP_ID>
8+
# More details about RSA key here:
9+
# https://docs.defguard.net/deployment-strategies/openid-rsa-key
10+
# DEFGUARD_OPENID_KEY=rsakey.pem
11+
# Accepted values: debug, info, warn, error
12+
DEFGUARD_LOG_LEVEL=info
13+
14+
## Proxy/Enrollment configuration ##
15+
DEFGUARD_ENROLLMENT_URL=<YOUR_DEFGUARD_ENROLLMENT_URL> # The URL of your Proxy - will be displayed during enrollment, email messages or desktop client configuration
16+
DEFGUARD_PROXY_URL=<YOUR_DEFGUARD_PROXY_GRPC_URL>
17+
# DEFGUARD_COOKIE_INSECURE=true # If you are accessing the dashboard via HTTP instead of HTTPS, set this to true.
18+
19+
## GRPC Certificate configuration ##
20+
# More info about securing gRPC communication here: https://docs.defguard.net/deployment-strategies/grpc-ssl-communication#custom-ssl-ca-and-certificates
21+
# DEFGUARD_GRPC_CERT=/certs/core.pem
22+
# DEFGUARD_GRPC_KEY=/certs/core.key
23+
# DEFGUARD_PROXY_GRPC_CA=/certs/ca.pem
24+
25+
## Database configuration ##
26+
# For the database container
27+
POSTGRES_DB=defguard
28+
POSTGRES_USER=defguard
29+
POSTGRES_PASSWORD=<YOUR_DB_PASSWORD>
30+
# For the Core container
31+
DEFGUARD_DB_HOST=db
32+
DEFGUARD_DB_PORT=5432
33+
DEFGUARD_DB_PASSWORD=<YOUR_DB_PASSWORD>
34+
DEFGUARD_DB_USER=defguard
35+
DEFGUARD_DB_NAME=defguard
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
services:
2+
core:
3+
image: ghcr.io/defguard/defguard:latest
4+
restart: unless-stopped
5+
container_name: "defguard"
6+
env_file: .env
7+
ports:
8+
# gRPC port for the Gateway to connect to
9+
# open on all interfaces/IPs - should be secured with custom CA (see .env)
10+
- "50055:50055"
11+
depends_on:
12+
db:
13+
condition: service_healthy
14+
# volumes:
15+
# More info here:
16+
# https://docs.defguard.net/deployment-strategies/openid-rsa-key
17+
# - ./rsakey.pem:/keys/rsakey.pem
18+
# More info about securing gRPC communication here:
19+
# https://docs.defguard.net/deployment-strategies/grpc-ssl-communication#custom-ssl-ca-and-certificates
20+
# - ./core.pem:/certs/core.pem
21+
# - ./core.key:/certs/core.key
22+
# - ./ca.pem:/certs/ca.pem
23+
24+
db:
25+
image: postgres:17-alpine
26+
restart: unless-stopped
27+
container_name: "defguard-db"
28+
env_file: .env
29+
volumes:
30+
- ./volumes/db:/var/lib/postgresql/data
31+
healthcheck:
32+
test: ["CMD-SHELL", "pg_isready -U defguard"]
33+
interval: 5s
34+
timeout: 5s
35+
retries: 5
36+
37+
npm:
38+
image: "jc21/nginx-proxy-manager:latest"
39+
restart: unless-stopped
40+
41+
ports:
42+
- "80:80" # HTTP Port
43+
- "443:443" # HTTPS Port
44+
- "81:81" # Admin Web Port
45+
46+
environment:
47+
TZ: "UTC"
48+
49+
volumes:
50+
- ./volumes/npm/data:/data
51+
- ./volumes/npm/letsencrypt:/etc/letsencrypt
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
gateway:
3+
image: ghcr.io/defguard/gateway:latest
4+
restart: unless-stopped
5+
container_name: "defguard-gateway"
6+
network_mode: "host"
7+
environment:
8+
- DEFGUARD_GRPC_URL=<CORE_GRPC_URL>
9+
- DEFGUARD_TOKEN=<GATEWAY_TOKEN>
10+
- DEFGUARD_LOG_LEVEL=info
11+
# More info about securing gRPC communication here:
12+
# https://docs.defguard.net/deployment-strategies/grpc-ssl-communication#custom-ssl-ca-and-certificates
13+
# - DEFGUARD_GRPC_CA=/ca.pem
14+
# volumes:
15+
# - ./ca.pem:/ca.pem
16+
cap_add:
17+
- NET_ADMIN
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
services:
2+
proxy:
3+
image: ghcr.io/defguard/defguard-proxy:latest
4+
restart: unless-stopped
5+
container_name: "defguard-proxy"
6+
ports:
7+
- "50051:50051"
8+
environment:
9+
- DEFGUARD_PROXY_URL=<PROXY_GRPC_URL>
10+
- DEFGUARD_LOG_LEVEL=info
11+
# More info about securing gRPC communication here:
12+
# https://docs.defguard.net/deployment-strategies/grpc-ssl-communication#custom-ssl-ca-and-certificates
13+
#- DEFGUARD_PROXY_GRPC_CERT=/certs/proxy.pem
14+
#- DEFGUARD_PROXY_GRPC_KEY=/certs/proxy.key
15+
# volumes:
16+
# - ./proxy.pem:/certs/proxy.pem
17+
# - ./proxy.key:/certs/proxy.key
18+
npm:
19+
image: "jc21/nginx-proxy-manager:latest"
20+
restart: unless-stopped
21+
ports:
22+
- "80:80" # HTTP Port
23+
- "443:443" # HTTPS Port
24+
- "81:81" # Admin Web Port
25+
26+
environment:
27+
TZ: "UTC"
28+
29+
volumes:
30+
- ./volumes/npm/data:/data
31+
- ./volumes/npm/letsencrypt:/etc/letsencrypt

0 commit comments

Comments
 (0)