123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- version: '3.7'
- # Environment variables are replaced with definitions in .env, when run with:
- #
- # env $(cat .env | grep ^[A-Z] | xargs) docker stack deploy --compose-file docker-compose.yml server
- networks:
- default:
- driver: overlay
- volumes:
- traefik-certs: {}
- services:
- traefik:
- image: traefik:v2.5.4
- ports:
- - 80:80
- - 443:443
- deploy:
- #replicas: 2 # https://youtu.be/btHpHjabRcc
- placement:
- constraints:
- - node.role == manager
- labels:
- - traefik.enable=true
- # Enable the dashboard UI
- - traefik.http.routers.api.rule=Host(`board.${DOMAIN}`)
- - traefik.http.routers.api.service=api@internal
- - traefik.http.routers.api.middlewares=auth
- - traefik.http.routers.api.tls=true
- - "traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_API_USERS}"
- # Dummy service for Swarm port detection. The port can be any valid integer value.
- - traefik.http.services.dummy-svc.loadbalancer.server.port=9999
- - traefik.http.routers.traefik.tls=true
- # Use LS to get/renew certs for the TLD & subdomains
- - traefik.http.routers.traefik.tls.certresolver=le
- - traefik.http.routers.traefik.tls.domains[0].main=${DOMAIN}
- - traefik.http.routers.traefik.tls.domains[0].sans=*.${DOMAIN}
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock:ro
- - ${CONTAINERS_DIR}/traefik/static.toml:/static.toml
- # cert storage can't be shared: https://doc.traefik.io/traefik/https/acme/#storage
- - traefik-certs:/certificates
- command:
- # Require a "traefik.enable=true" label
- - --providers.docker.exposedbydefault=false
- - --providers.docker.swarmmode=true
- # HTTP redirects to HTTPS
- - --entrypoints.web.address=:80
- - --entrypoints.web.http.redirections.entrypoint.permanent=false
- - --entrypoints.web.http.redirections.entryPoint.to=websecure
- - --entrypoints.web.http.redirections.entryPoint.scheme=https
- - --entrypoints.websecure.address=:443
- # Auto cert renewal via cloudflare
- - --certificatesresolvers.le.acme.email=${LETSENCRYPT_EMAIL}
- - --certificatesresolvers.le.acme.storage=/certificates/acme.json
- - --certificatesresolvers.le.acme.dnschallenge.provider=cloudflare
- - --certificatesresolvers.le.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53
- # debug, uncomment for testing
- #- --certificatesresolvers.le.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
- #- --log.level=DEBUG
- - --accesslog=true
- - --log=true
- # Enable the traefik dashboard
- - --api=true
- - --providers.file.filename=/static.toml
- environment:
- - CLOUDFLARE_EMAIL=${CLOUDFLARE_EMAIL}
- - CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
- jekyll:
- image: jibby0/docker-jekyll-webhook
- deploy:
- replicas: 2
- labels:
- - traefik.enable=true
- - traefik.http.routers.jekyll.tls=true
- - traefik.http.routers.jekyll.rule=Host(`${DOMAIN}`)
- - traefik.http.services.jekyll.loadbalancer.server.port=80
- environment:
- - TZ=America/New_York
- - WEBHOOK_SECRET=${WEBHOOK_SECRET}
- - REPO=https://github.com/jibby0/blog.git
- restart: always
- volumes:
- - ${CONTAINERS_DIR}/jekyll/vendor_cache:/vendor
- postgres:
- image: postgres:13.2
- volumes:
- - ${CONTAINERS_DIR}/postgres/data:/var/lib/postgresql/data
- - ${CONTAINERS_DIR}/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- environment:
- - POSTGRES_USER=${POSTGRES_USER}
- - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- restart: always
- nextcloud:
- image: nextcloud:20.0.9
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.nextcloud.tls=true
- - traefik.http.routers.nextcloud.rule=Host(`nextcloud.${DOMAIN}`)
- - traefik.http.services.nextcloud.loadbalancer.server.port=80
- expose:
- - "80"
- links:
- - postgres
- volumes:
- - ${CONTAINERS_DIR}/nextcloud:/var/www/html
- restart: always
- gogs:
- image: gogs/gogs:0.12.0
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.gogs.tls=true
- - traefik.http.routers.gogs.rule=Host(`gogs.${DOMAIN}`)
- - traefik.http.services.gogs.loadbalancer.server.port=3000
- expose:
- - "3000"
- volumes:
- - ${CONTAINERS_DIR}/gogs:/data
- # NOTE: My gogs instance isn't happy with postgres. For now, it's a small server
- # and sqlite is fine, but I should fix this eventually.
- #links:
- # - postgres
- restart: always
- matrix:
- image: matrixdotorg/synapse:v1.46.0
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.matrix.tls=true
- - traefik.http.routers.matrix.rule=Host(`matrix.${DOMAIN}`)
- - traefik.http.services.matrix.loadbalancer.server.port=8008
- expose:
- - "8008"
- links:
- - postgres
- # NOTE: These don't directly configure anything anymore.
- # They can be used with `migrate_config` to build
- # homeserver.yaml
- # environment:
- # - SYNAPSE_SERVER_NAME=matrix.${DOMAIN}
- # - SYNAPSE_REPORT_STATS=no
- # - SYNAPSE_NO_TLS=true
- # - SYNAPSE_ENABLE_REGISTRATION=no
- # - SYNAPSE_LOG_LEVEL=INFO
- # - SYNAPSE_REGISTRATION_SHARED_SECRET=${POSTGRES_PASSWORD}
- # - POSTGRES_DB=synapse
- # - POSTGRES_HOST=postgres
- # - POSTGRES_USER=synapse
- # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- volumes:
- - ${CONTAINERS_DIR}/matrix:/data
- restart: always
- matrix_wellknown:
- image: adrianrudnik/matrix-wellknown-server:1.0.1
- volumes:
- - ${CONTAINERS_DIR}/matrix/wellknown:/var/schema
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.matrix-wellknown.tls=true
- - traefik.http.routers.matrix-wellknown.rule=Host(`matrix.${DOMAIN}`) && PathPrefix(`/.well-known/matrix/`)
- - traefik.http.services.matrix-wellknown.loadbalancer.server.port=8080
- expose:
- - "8080"
- selfoss:
- image: jibby0/selfoss:2.18
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.selfoss.tls=true
- - traefik.http.routers.selfoss.rule=Host(`selfoss.${DOMAIN}`)
- - traefik.http.services.selfoss.loadbalancer.server.port=8888
- expose:
- - "8888"
- links:
- - postgres
- volumes:
- - ${CONTAINERS_DIR}/selfoss:/selfoss/data
- environment:
- - CRON_PERIOD=5m
- restart: always
- plex:
- image: ghcr.io/linuxserver/plex:version-1.25.1.5286-34f965be8
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.plex.tls=true
- - traefik.http.routers.plex.rule=Host(`plex.${DOMAIN}`)
- - traefik.http.services.plex.loadbalancer.server.port=32400
- expose:
- - "32400"
- volumes:
- - ${CONTAINERS_DIR}/plex:/config
- - ${MEDIA_DIR}/Video/Movies:/movies:ro
- - ${MEDIA_DIR}/Video/Shows:/tv:ro
- - ${MEDIA_DIR}/Video/Anime:/Anime:ro
- - type: tmpfs
- target: /transcodes
- tmpfs:
- size: 12000000000 # ~12gb
- restart: always
- jellyfin:
- # 10.6.4 can't use Chromecasts properly: https://github.com/jellyfin/jellyfin/issues/3852
- # The "jellyfixer" service below fixes that for now. Assumes jellyfin's
- # baseURL is set to the default of `/jellyfin`
- image: jellyfin/jellyfin:10.6.4
- deploy:
- placement:
- constraints:
- - node.labels.media-encoding == true
- labels:
- - traefik.enable=true
- - traefik.http.routers.jellyfin.tls=true
- - traefik.http.routers.jellyfin.rule=Host(`jellyfin.${DOMAIN}`)
- - traefik.http.services.jellyfin.loadbalancer.server.port=8096
- expose:
- - "8096"
- volumes:
- - ${CONTAINERS_DIR}/jellyfin:/config
- - ${MEDIA_DIR}:/media
- restart: always
- jellyfixer:
- image: quay.io/xsteadfastx/jellyfixer:latest
- deploy:
- labels:
- - traefik.enable=true
- - traefik.http.routers.jellyfixer-secured.tls=true
- - traefik.http.routers.jellyfixer-secured.rule=Host(`jellyfin.${DOMAIN}`) && Path(`/jellyfin/System/Info/Public`)
- - traefik.http.services.jellyfixer-secured.loadbalancer.server.port=8088
- command: http://jellyfin:8096/jellyfin
- environment:
- - JELLYFIXER_INTERNAL_URL=http://jellyfin:8096/jellyfin
- - JELLYFIXER_EXTERNAL_URL=https://jellyfin.${DOMAIN}/jellyfin
|