2025-04-22 07:56:42 -05:00
|
|
|
# Continuwuity - Behind Traefik Reverse Proxy
|
2020-08-02 15:55:40 +02:00
|
|
|
|
|
|
|
|
services:
|
2024-08-31 14:08:31 +02:00
|
|
|
homeserver:
|
2025-04-20 23:50:48 +01:00
|
|
|
image: forgejo.ellis.link/continuwuation/continuwuity:latest
|
2024-08-31 14:08:31 +02:00
|
|
|
restart: unless-stopped
|
2026-03-11 14:59:58 +01:00
|
|
|
command: /sbin/conduwuit
|
2024-08-31 14:08:31 +02:00
|
|
|
volumes:
|
2025-05-10 20:37:08 +01:00
|
|
|
- db:/var/lib/continuwuity
|
|
|
|
|
#- ./continuwuity.toml:/etc/continuwuity.toml
|
2024-08-31 14:08:31 +02:00
|
|
|
networks:
|
|
|
|
|
- proxy
|
2025-07-30 19:33:53 +01:00
|
|
|
labels:
|
|
|
|
|
- "traefik.enable=true"
|
2025-07-30 19:55:48 +01:00
|
|
|
- "traefik.http.routers.continuwuity.rule=(Host(`matrix.example.com`) || (Host(`example.com`) && PathPrefix(`/.well-known/matrix`)))"
|
|
|
|
|
- "traefik.http.routers.continuwuity.entrypoints=websecure"
|
|
|
|
|
- "traefik.http.routers.continuwuity.tls.certresolver=letsencrypt"
|
2026-03-28 09:22:40 +00:00
|
|
|
- "traefik.http.services.continuwuity.loadbalancer.server.port=8008"
|
2024-08-31 14:08:31 +02:00
|
|
|
environment:
|
2026-03-28 09:22:40 +00:00
|
|
|
CONTINUWUITY_SERVER_NAME: example.com # EDIT THIS
|
2026-03-28 09:22:40 +00:00
|
|
|
CONTINUWUITY_DATABASE_PATH: /var/lib/continuwuity
|
2025-05-10 20:37:08 +01:00
|
|
|
CONTINUWUITY_ADDRESS: 0.0.0.0
|
2026-03-28 09:22:40 +00:00
|
|
|
CONTINUWUITY_PORT: 8008 # This must match with traefik's loadbalancer label
|
2025-05-10 20:37:08 +01:00
|
|
|
#CONTINUWUITY_CONFIG: '/etc/continuwuity.toml' # Uncomment if you mapped config toml above
|
2020-08-02 15:55:40 +02:00
|
|
|
|
2025-05-10 20:37:08 +01:00
|
|
|
# We need some way to serve the client and server .well-known json. The simplest way is via the CONTINUWUITY_WELL_KNOWN
|
|
|
|
|
# variable / config option, there are multiple ways to do this, e.g. in the continuwuity.toml file, and in a separate
|
2024-08-31 14:08:31 +02:00
|
|
|
# reverse proxy, but since you do not have a reverse proxy and following this guide, this example is included
|
2025-05-10 20:37:08 +01:00
|
|
|
CONTINUWUITY_WELL_KNOWN: |
|
2024-08-31 14:08:31 +02:00
|
|
|
{
|
2026-03-28 09:22:40 +00:00
|
|
|
client=https://matrix.example.com,
|
|
|
|
|
server=matrix.example.com:443
|
2024-08-31 14:08:31 +02:00
|
|
|
}
|
|
|
|
|
#cpuset: "0-4" # Uncomment to limit to specific CPU cores
|
2025-04-22 07:56:42 -05:00
|
|
|
ulimits: # Continuwuity uses quite a few file descriptors, and on some systems it defaults to 1024, so you can tell docker to increase it
|
2024-08-31 14:08:31 +02:00
|
|
|
nofile:
|
|
|
|
|
soft: 1048567
|
|
|
|
|
hard: 1048567
|
2026-03-30 09:14:08 +00:00
|
|
|
configs: # using custom resolver instead of Docker's
|
|
|
|
|
- source: continuwuity-resolv.conf
|
|
|
|
|
target: /etc/resolv.conf
|
2021-08-17 14:44:53 +02:00
|
|
|
|
2024-08-31 14:08:31 +02:00
|
|
|
traefik:
|
|
|
|
|
image: "traefik:latest"
|
|
|
|
|
container_name: "traefik"
|
|
|
|
|
restart: "unless-stopped"
|
|
|
|
|
ports:
|
|
|
|
|
- "80:80"
|
|
|
|
|
- "443:443"
|
|
|
|
|
volumes:
|
|
|
|
|
- "/var/run/docker.sock:/var/run/docker.sock:z"
|
|
|
|
|
- "acme:/etc/traefik/acme"
|
|
|
|
|
labels:
|
|
|
|
|
- "traefik.enable=true"
|
2022-02-19 17:06:06 +01:00
|
|
|
|
2024-08-31 14:08:31 +02:00
|
|
|
# middleware redirect
|
|
|
|
|
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
|
|
|
|
# global redirect to https
|
|
|
|
|
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
|
|
|
|
|
- "traefik.http.routers.redirs.entrypoints=web"
|
|
|
|
|
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
|
2022-02-19 17:06:06 +01:00
|
|
|
|
2024-08-31 14:08:31 +02:00
|
|
|
environment:
|
|
|
|
|
TRAEFIK_LOG_LEVEL: DEBUG
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEB: true
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEB_ADDRESS: ":80"
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_TO: websecure
|
|
|
|
|
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEBSECURE: true
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEBSECURE_ADDRESS: ":443"
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEBSECURE_HTTP_TLS_CERTRESOLVER: letsencrypt
|
|
|
|
|
|
|
|
|
|
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT: true
|
2026-03-28 17:45:47 +00:00
|
|
|
# CHANGE THIS to desired email for ACME
|
|
|
|
|
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_EMAIL: user@example.com
|
2024-08-31 14:08:31 +02:00
|
|
|
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_HTTPCHALLENGE: true
|
|
|
|
|
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_HTTPCHALLENGE_ENTRYPOINT: web
|
|
|
|
|
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_STORAGE: "/etc/traefik/acme/acme.json"
|
|
|
|
|
|
2025-12-24 22:40:50 -05:00
|
|
|
# Since Traefik 3.6.3, paths with certain "encoded characters" are now blocked by default; we need a couple, or else things *will* break
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEBSECURE_HTTP_ENCODEDCHARACTERS_ALLOWENCODEDSLASH: true
|
|
|
|
|
TRAEFIK_ENTRYPOINTS_WEBSECURE_HTTP_ENCODEDCHARACTERS_ALLOWENCODEDHASH: true
|
|
|
|
|
|
2024-08-31 14:08:31 +02:00
|
|
|
TRAEFIK_PROVIDERS_DOCKER: true
|
|
|
|
|
TRAEFIK_PROVIDERS_DOCKER_ENDPOINT: "unix:///var/run/docker.sock"
|
|
|
|
|
TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT: false
|
|
|
|
|
|
2020-08-02 15:55:40 +02:00
|
|
|
volumes:
|
|
|
|
|
db:
|
2022-02-19 17:06:06 +01:00
|
|
|
acme:
|
2020-08-02 15:55:40 +02:00
|
|
|
|
|
|
|
|
networks:
|
2024-04-23 01:39:13 -04:00
|
|
|
proxy:
|
2026-03-30 09:14:08 +00:00
|
|
|
|
|
|
|
|
configs:
|
|
|
|
|
continuwuity-resolv.conf:
|
|
|
|
|
content: |
|
|
|
|
|
nameserver 1.0.0.1
|
|
|
|
|
nameserver 1.1.1.1
|