services:
  <<SANDBOX_GATEWAY_SERVICE>>:
    image: <<SANDBOX_GATEWAY_IMAGE>>
    pull_policy: if_not_present
    container_name: <<SANDBOX_GATEWAY_DOCKER>>
    ports:
      - "<<SANDBOX_GATEWAY_HOST_PORT>>:<<SANDBOX_GATEWAY_PORT>>"
    environment:
      - SANDBOX_SERVER_URL=http://<<SANDBOX_SERVER_SERVICE>>:<<SANDBOX_SERVER_PORT>>/run
    networks:
      - <<JIUWEN_NETWORK_NAME>>
    restart: unless-stopped
    healthcheck:
      test:
        [
          "CMD",
          "curl",
          "-f",
          "http://localhost:<<SANDBOX_GATEWAY_PORT>>/health",
        ]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 60s

  <<SANDBOX_SERVER_SERVICE>>:
    image: <<SANDBOX_SERVER_IMAGE>>
    pull_policy: if_not_present
    container_name: <<SANDBOX_SERVER_DOCKER>>
    ports:
      - "<<SANDBOX_SERVER_HOST_PORT>>:<<SANDBOX_SERVER_PORT>>"
    environment:
      - ENABLE_LINUX_SANDBOX=<<ENABLE_LINUX_SANDBOX>>
    networks:
      - <<JIUWEN_NETWORK_NAME>>
    restart: unless-stopped
    healthcheck:
      test:
        ["CMD", "curl", "-f", "http://localhost:<<SANDBOX_SERVER_PORT>>/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 60s
    cap_add:
      - SYS_ADMIN
      - NET_ADMIN
    security_opt:
      - seccomp=unconfined
      - apparmor=unconfined
      - systempaths=unconfined

networks:
  <<JIUWEN_NETWORK_NAME>>:
    driver: bridge