diff --git a/.env.sample b/.env.sample index eeee31f..190f5b8 100644 --- a/.env.sample +++ b/.env.sample @@ -7,6 +7,9 @@ COMPOSE_FILE="compose.yml" ## Domain aliases #EXTRA_DOMAINS=', `www.baserow.example.com`' +## Automatically use subdomains under following domain (anything.example.com) +#WILDCARD_DOMAIN='example.com' + LETS_ENCRYPT_ENV=production # COMPOSE_FILE="$COMPOSE_FILE:compose.email.yml" diff --git a/compose.yml b/compose.yml index 213d18c..370c6bf 100644 --- a/compose.yml +++ b/compose.yml @@ -11,6 +11,7 @@ services: - SECRET_KEY_FILE=/run/secrets/secret_key - BASEROW_JWT_SIGNING_KEY_FILE=/run/secrets/baserow_jwt_signing_key - BASEROW_CADDY_ADDRESSES=:80 + - BASEROW_BUILDER_DOMAINS=${WILDCARD_DOMAIN} secrets: - secret_key - baserow_jwt_signing_key @@ -20,7 +21,7 @@ services: labels: - "traefik.enable=true" - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" - - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS}) || HostRegexp(`{subdomain:\\w+}.${WILDCARD_DOMAIN}`)" - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" ## Redirect from EXTRA_DOMAINS to DOMAIN