# \[High, Serve\] Ray Cluster using docker containers

**URL:** <https://discuss.ray.io/t/high-serve-ray-cluster-using-docker-containers/13258>\
**Category:** Ray Serve\
**Created:** [December 26, 2023, 7:17am UTC](https://discuss.ray.io/t/high-serve-ray-cluster-using-docker-containers/13258 "2023-12-26T07:17:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psydok](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/psydok/32/3518_2.png) [@psydok](https://discuss.ray.io/u/psydok)\
**Post date:** [December 26, 2023, 7:17am UTC](https://discuss.ray.io/t/high-serve-ray-cluster-using-docker-containers/13258/1 "2023-12-26T07:17:05Z")

</div>

I want to connect remote servers to a cluster using docker containers. But there is a firewall on the servers. In normal case I managed to organise a cluster using mod: network\_mode: host. But because of firewall I have to search which ports ray need to write and open and specify external ip in node-ip-address. For head node - `node-ip-address` does not work. In case of remote banks - there is a problem when trying to serve on them ([[Medium] Using docker image for service deployment - #7 by psydok](https://discuss.ray.io/t/medium-using-docker-image-for-service-deployment/13111/7)). Also log files of deleted nodes are not loaded in the interface for some reason. That is also a problem.

I don’t understand what else needs to be opened or done to connect nodes to each other without k8s.

```docker
version: "3.7"

services:
  node:
    build:
      context: ./
      dockerfile: ./docker/Dockerfile
    env_file:
      - .env
    volumes:
      - /tmp/ray:/tmp/ray
    runtime: nvidia
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "10"
    tty: true
    privileged: true
    ports:
      - ${OBJECT_MANAGER_PORT}:${OBJECT_MANAGER_PORT}
      - ${NODE_MANAGER_PORT}:${NODE_MANAGER_PORT}
      - ${RAY_CLIENT_PORT}:${RAY_CLIENT_PORT}
      - ${MIN_WORKER_PORT}-${MAX_WORKER_PORT}:${MIN_WORKER_PORT}-${MAX_WORKER_PORT}
      - ${RAY_DASHBOARD_PORT}:${RAY_DASHBOARD_PORT}
      - ${RAY_HEAD_PORT}:${RAY_HEAD_PORT}
      - ${DASHBOARD_AGENT_LISTEN_PORT}:${DASHBOARD_AGENT_LISTEN_PORT}
      - ${RUNTIME_ENV_AGENT_PORT}:${RUNTIME_ENV_AGENT_PORT}

```

```bash
# entrypoint.sh in dockerfile

RAY_prestart_worker_first_driver=2 ray start --head --dashboard-host 0.0.0.0 --num-cpus=0 \
    --port=$RAY_HEAD_PORT \
    --runtime-env-agent-port $RUNTIME_ENV_AGENT_PORT \
    --node-ip-address=${CURRENT_NODE_IP:-0.0.0.0}\
    --min-worker-port=$MIN_WORKER_PORT \
    --max-worker-port=$MAX_WORKER_PORT \
    --node-manager-port=$NODE_MANAGER_PORT \
    --object-manager-port=$OBJECT_MANAGER_PORT \
    --ray-client-server-port=$RAY_CLIENT_PORT \
    --dashboard-agent-listen-port=$DASHBOARD_AGENT_LISTEN_PORT \
    --ray-debugger-external \
    --block

```
