services:
  server:
    image: runewarp/runewarp:local
    command: ["server"]
    environment:
      XDG_CONFIG_HOME: /runewarp/config
      XDG_DATA_HOME: /runewarp/data
      XDG_STATE_HOME: /runewarp/state
    ports:
      - "8443:443/tcp"
    volumes:
      - ./generated/server:/runewarp:ro
    networks:
      default:
        aliases:
          - tunnel.example.test

  client:
    image: runewarp/runewarp:local
    command: ["client"]
    environment:
      XDG_CONFIG_HOME: /runewarp/config
      XDG_DATA_HOME: /runewarp/data
      XDG_STATE_HOME: /runewarp/state
    depends_on:
      - server
      - caddy
    volumes:
      - ./generated/client:/runewarp:ro

  caddy:
    image: caddy:2
    volumes:
      - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./generated/caddy/data:/data
      - ./generated/caddy/config:/config
