Skip to content

Instantly share code, notes, and snippets.

@oleoneto
Last active June 27, 2022 23:04
Show Gist options
  • Save oleoneto/3fa54fee1ff3cc6b6e102381692099d3 to your computer and use it in GitHub Desktop.
Save oleoneto/3fa54fee1ff3cc6b6e102381692099d3 to your computer and use it in GitHub Desktop.
Send Azuracast NGINX traffic through Traefik
#
# Repaus Media Server
# AzuraCast Docker Compose Configuration File
# Settings override
version: '2.2'
networks:
proxy:
external:
name: proxy_network
services:
mariadb:
container_name: mariadb
influxdb:
container_name: influxdb
redis:
container_name: redis
ports:
- 6378:6379
# Use Traefik to handle requests
# ==============================
nginx_proxy:
container_name: nginx
ports:
- '8888:80'
- '8443:443'
labels:
traefik.enable: "true"
traefik.http.routers.nginx_proxy.rule: Host(`example.com`)
networks:
- proxy
web:
container_name: azuracast
networks:
- repaus
volumes:
- /var/azuracast/stations:/var/azuracast/stations
labels:
traefik.enable: "true"
traefik.http.routers.web.rule: Host(`sftp.example.com`)
stations:
container_name: stations
networks:
- proxy
volumes:
- /var/azuracast/stations:/var/azuracast/stations
labels:
traefik.enable: "true"
traefik.http.routers.stations.rule: Host(`stream.example.com`)
version: "3.7"
networks:
proxy:
name: proxy_network
services:
traefik:
container_name: traefik
image: traefik:v2.2
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`monitor.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.service=api@internal"
command:
- --providers.docker.network=proxy
ports:
- 80:80 # host:docker => http
- 443:443 # host:docker => https
- 8080:8080 # host:docker => dashboard
networks:
- repaus
volumes:
- ./traefik.yml:/etc/traefik/traefik.yml
- ./letsencrypt:/letsencrypt # <== Volume for certs (TLS)
- /var/run/docker.sock:/var/run/docker.sock # <== Volume for docker admin
restart: always
# Good for testing if everything is in place
whoami:
image: containous/whoami
container_name: whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.example.com`)"
networks:
- proxy
################################################################
#
# Configuration sample for Traefik v2.
#
# For Traefik v1: https://github.com/traefik/traefik/blob/v1.7/traefik.sample.toml
#
################################################################
################################################################
# Global configuration
################################################################
global:
checkNewVersion: true
sendAnonymousUsage: false
################################################################
# EntryPoints configuration
################################################################
# EntryPoints definition
#
# Optional
#
entryPoints:
web:
address: :80
websecure:
address: :443
################################################################
# Traefik logs configuration
################################################################
# Traefik logs
# Enabled by default and log to stdout
#
# Optional
#
log:
# Log level
#
# Optional
# Default: "ERROR"
#
level: "DEBUG"
# Sets the filepath for the traefik log. If not specified, stdout will be used.
# Intermediate directories are created if necessary.
#
# Optional
# Default: os.Stdout
#
filePath: log/traefik.log
# Format is either "json" or "common".
#
# Optional
# Default: "common"
#
format: "common"
################################################################
# Access logs configuration
################################################################
# Enable access logs
# By default it will write to stdout and produce logs in the textual
# Common Log Format (CLF), extended with additional fields.
#
# Optional
#
accessLog:
# Sets the file path for the access log. If not specified, stdout will be used.
# Intermediate directories are created if necessary.
#
# Optional
# Default: os.Stdout
#
filePath: log/traefik-access.txt
# Format is either "json" or "common".
#
# Optional
# Default: "common"
#
format: "common"
################################################################
# API and dashboard configuration
## API Settings - https://docs.traefik.io/operations/api/, endpoints - https://docs.traefik.io/operations/api/#endpoints ##
################################################################
# Enable API and dashboard
#
# Optional
#
api:
# Enable the API in insecure mode
#
# Optional
# Default: false
#
insecure: false
# Enabled Dashboard
#
# Optional
# Default: true
#
dashboard: true
################################################################
# Ping configuration
################################################################
# Enable ping
ping:
# Name of the related entry point
#
# Optional
# Default: "traefik"
#
entryPoint: traefik
################################################################
# Docker configuration backend
################################################################
providers:
# Enable Docker configuration backend
docker:
# Docker server endpoint. Can be a tcp or a unix socket endpoint.
#
# Required
# Default: "unix:///var/run/docker.sock"
#
endpoint: "unix:///var/run/docker.sock"
# Default host rule.
#
# Optional
# Default: "Host(`{{ normalize .Name }}`)"
#
defaultRule: Host(`{{ normalize .Name }}.docker.localhost`)
# Expose containers by default in traefik
#
# Optional
# Default: true
#
exposedByDefault: false
certificatesResolvers:
http:
acme:
email: user@example.com
storage: acme.json
httpChallenge:
entryPoint: http
@joeyboli
Copy link

this still work ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment