diff --git a/docker-compose.yml b/docker-compose.yml index b96c5c9..c3637b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,6 @@ name: testbed services: master: image: ghcr.io/ucla-irl/testbed-master:latest - restart: unless-stopped init: true tty: true dns: # prevent resolving to 127.0.0.1 @@ -21,13 +20,13 @@ services: entrypoint: /bin/bash command: [scripts/master.sh] working_dir: /testbed + restart: unless-stopped healthcheck: test: [CMD, stat, /testbed/dist/.master-ready] interval: 3s caddy: - image: caddy:2 - restart: unless-stopped + image: ghcr.io/ucla-irl/testbed-caddy:latest cap_add: - NET_ADMIN ports: @@ -38,6 +37,7 @@ services: - ${PWD}/dist/caddy/Caddyfile:/etc/caddy/Caddyfile:ro - ${PWD}/dist/caddy/data:/data - ${PWD}/dist/caddy/config:/config + restart: unless-stopped depends_on: master: { condition: service_healthy } diff --git a/templates/caddy/Caddyfile.j2 b/templates/caddy/Caddyfile.j2 index bab9ca5..9e11c99 100644 --- a/templates/caddy/Caddyfile.j2 +++ b/templates/caddy/Caddyfile.j2 @@ -1,8 +1,17 @@ {{ ansible_host }} -reverse_proxy http://nfd-http-status-server:8080 +@nfdstatus { + path / + path /nfd-status.xsl + path /*.css +} + +reverse_proxy @nfdstatus http://nfd-http-status-server:8080 reverse_proxy /ws* http://nfd:9696 +root * /srv +file_server + {% if is_root_ca is defined %} handle_path /root-ca* { reverse_proxy http://root-http-ca:8777