105 lines
3.6 KiB
YAML
Executable File
105 lines
3.6 KiB
YAML
Executable File
# Primary compose file, used to manage the traefik and other network related modules
|
|
# Other compose files to be run named and used my service
|
|
|
|
services:
|
|
wg-easy:
|
|
image: ghcr.io/wg-easy/wg-easy:15
|
|
container_name: wireguard
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./etc_wireguard:/etc/wireguard
|
|
environment:
|
|
- PORT=51821
|
|
- INSECURE=true
|
|
cap_add:
|
|
- NET_ADMIN
|
|
- SYS_MODULE
|
|
sysctls:
|
|
- net.ipv4.conf.all.src_valid_mark=1
|
|
- net.ipv4.ip_forward=1
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "51820:51820/udp"
|
|
# - "9000:9000"
|
|
# - "53:53"
|
|
networks:
|
|
- backend
|
|
dns:
|
|
- 1.1.1.1
|
|
- 8.8.8.8
|
|
extra_hosts:
|
|
- "ca.dfnk:127.0.0.1"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.services.wg-easy-svc.loadbalancer.server.port=51821"
|
|
- "traefik.http.services.wg-easy-svc.loadbalancer.server.url=http://127.0.0.1:51821"
|
|
|
|
# Configuration for public access with auth middleware
|
|
- "traefik.http.routers.wg-easy.rule=Host(`wg.riverrooks.dev`)"
|
|
- "traefik.http.routers.wg-easy.entrypoints=websecure"
|
|
- "traefik.http.routers.wg-easy.tls.certresolver=basic"
|
|
- "traefik.http.routers.wg-easy.middlewares=auth"
|
|
- "traefik.http.routers.wg-easy.service=wg-easy-svc"
|
|
- "traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$cnS8Mv7V$$djacpseKy6M4.XbgG4kgb1"
|
|
|
|
# configured for private access with no auth
|
|
- "traefik.http.routers.wg-easy-private.rule=Host(`wg.dfnk`)"
|
|
- "traefik.http.routers.wg-easy-private.entrypoints=websecure"
|
|
# No certresolver here, will mess with browsers
|
|
- "traefik.http.routers.wg-easy-private.tls=true"
|
|
- "traefik.http.routers.wg-easy-private.tls.certresolver=defenk"
|
|
- "traefik.http.routers.wg-easy-private.service=wg-easy-svc"
|
|
|
|
traefik: # This is the proxy for all other services. Using labels it dynamically secures reverse proxies to other containters
|
|
image: traefik:v3.6
|
|
container_name: traefik
|
|
restart: unless-stopped
|
|
network_mode: "service:wg-easy"
|
|
depends_on:
|
|
- wg-easy
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock" # running as root TODO need to make new user
|
|
- "./letsencrypt:/letsencrypt"
|
|
- "./traefik.yml:/etc/traefik/traefik.yml:ro" # sets the traefik.yml file as the options file for configuring proxy settings
|
|
- "./dynamic.yml:/etc/traefik/dynamic.yml:ro" # sets the traefik.yml file as the options file for configuring proxy settings
|
|
- "./step-ca/certs/root_ca.crt:/etc/traefik/certs/root_ca.crt:ro" #Maps traefik root cert to the one being used by step-ca
|
|
environment:
|
|
- DESEC_TOKEN=RnKb69i8npX4HyvLr25NnQ1p25Kr
|
|
- LEGO_DISABLE_CNAME_SUPPORT=true
|
|
- LEGO_CA_CERTIFICATES=/etc/traefik/certs/root_ca.crt
|
|
dns:
|
|
image: dockurr/dnsmasq
|
|
container_name: defenk-dns
|
|
volumes:
|
|
- ./dnsmasq.conf:/etc/dnsmasq.conf
|
|
restart: always
|
|
network_mode: "service:wg-easy"
|
|
depends_on:
|
|
- wg-easy
|
|
step-ca:
|
|
image: smallstep/step-ca:latest
|
|
container_name: defenk-step-ca
|
|
restart: unless-stopped
|
|
# ports:
|
|
# - "9000:9000"
|
|
volumes:
|
|
- ./step-ca/:/home/step
|
|
environment:
|
|
- DOCKER_STEPCA_INIT_NAME=DEFENK CA
|
|
- DOCKER_STEPCA_INIT_DNS_NAMES=ca.dfnk
|
|
- DOCKER_STEPCA_INIT_PASSWORD_FILE=/home/step/password.txt
|
|
depends_on:
|
|
- wg-easy
|
|
network_mode: "service:wg-easy"
|
|
# networks:
|
|
# backend:
|
|
# - ca.dfnk
|
|
# - step-ca
|
|
|
|
networks:
|
|
# Backend network for docker containers to talk to eachother
|
|
backend:
|
|
name: backend
|
|
driver: bridge
|