variablize guacamole yml compose file
This commit is contained in:
parent
8dee03252d
commit
7364193204
1 changed files with 14 additions and 24 deletions
|
|
@ -9,8 +9,8 @@ services:
|
||||||
mem_reservation: "1024m"
|
mem_reservation: "1024m"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRESQL_USERNAME: guacamole_user
|
POSTGRESQL_USERNAME: ${PG_USERNAME}
|
||||||
POSTGRESQL_PASSWORD: apts22$$
|
POSTGRESQL_PASSWORD: ${PG_PASSWORD}
|
||||||
POSTGRESQL_DB: guacamole_db
|
POSTGRESQL_DB: guacamole_db
|
||||||
volumes:
|
volumes:
|
||||||
- /docker/guacamole/init:/docker-entrypoint-initdb.d:ro # Loads schema on first boot
|
- /docker/guacamole/init:/docker-entrypoint-initdb.d:ro # Loads schema on first boot
|
||||||
|
|
@ -46,34 +46,24 @@ services:
|
||||||
GUACD_HOSTNAME: guacd
|
GUACD_HOSTNAME: guacd
|
||||||
POSTGRESQL_HOSTNAME: guac-db
|
POSTGRESQL_HOSTNAME: guac-db
|
||||||
POSTGRESQL_DATABASE: guacamole_db
|
POSTGRESQL_DATABASE: guacamole_db
|
||||||
POSTGRESQL_USERNAME: guacamole_user
|
POSTGRESQL_USERNAME: ${PG_USERNAME}
|
||||||
POSTGRESQL_PASSWORD: apts22$$
|
POSTGRESQL_PASSWORD: ${PG_PASSWORD}
|
||||||
CATALINA_OPTS: "-Djava.security.egd=file:/dev/./urandom -Xms1g -Xmx2g"
|
CATALINA_OPTS: "-Djava.security.egd=file:/dev/./urandom -Xms1g -Xmx2g"
|
||||||
networks:
|
networks:
|
||||||
- guac_internal
|
- guac_internal
|
||||||
- guac_external # Connects to Traefik
|
- guac_external # Connects to Traefik
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=${TRAEFIK_ENABLED:-false}"
|
||||||
- "traefik.http.routers.guac.rule=Host(`ssh.mapletree.email`)"
|
# Routing Logic
|
||||||
- "traefik.http.routers.guac.entrypoints=websecure"
|
- "traefik.http.routers.${SERVICE_NAME}.rule=Host(`${SUBDOMAIN}.${ENV_DOMAIN}`)"
|
||||||
- "traefik.http.routers.guac.tls=true"
|
- "traefik.http.routers.${SERVICE_NAME}.entrypoints=${TRAEFIK_ENTRYPOINT:-websecure}"
|
||||||
- "traefik.http.services.guac.loadbalancer.server.port=8080"
|
- "traefik.http.routers.${SERVICE_NAME}.tls=true"
|
||||||
- "traefik.http.routers.guac.tls.certresolver=myresolver"
|
- "traefik.http.routers.${SERVICE_NAME}.tls.certresolver=${TRAEFIK_RESOLVER:-myresolver}"
|
||||||
- "traefik.docker.network=guac_external"
|
# Service Logic
|
||||||
|
- "traefik.http.services.${SERVICE_NAME}.loadbalancer.server.port=${INTERNAL_PORT:-80}"
|
||||||
|
# Middleware Logic
|
||||||
|
- "traefik.http.routers.${SERVICE_NAME}.middlewares=${MIDDLEWARES:-}"
|
||||||
|
|
||||||
# Middleware 1: Redirect
|
|
||||||
- "traefik.http.middlewares.guac-redirect.redirectregex.regex=^https://([^/]+)/?$$"
|
|
||||||
- "traefik.http.middlewares.guac-redirect.redirectregex.replacement=https://$${1}/guacamole/"
|
|
||||||
|
|
||||||
# Middleware 2: Disable Buffering (Stability Fix)
|
|
||||||
- "traefik.http.middlewares.guac-buffer.buffering.maxResponseBodyBytes=0"
|
|
||||||
- "traefik.http.middlewares.guac-buffer.buffering.maxRequestBodyBytes=0"
|
|
||||||
- "traefik.http.middlewares.guac-buffer.buffering.memRequestBodyBytes=0"
|
|
||||||
- "traefik.http.middlewares.guac-buffer.buffering.memResponseBodyBytes=0"
|
|
||||||
- "traefik.http.middlewares.guac-buffer.buffering.retryExpression=IsNetworkError() && Attempts() <= 2"
|
|
||||||
|
|
||||||
# Apply Both
|
|
||||||
- "traefik.http.routers.guac.middlewares=guac-redirect,guac-buffer"
|
|
||||||
networks:
|
networks:
|
||||||
guac_internal:
|
guac_internal:
|
||||||
internal: true
|
internal: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue