Skip to content

Commit

Permalink
Merge pull request vircadia#1734 from vircadia/feature/multi-server
Browse files Browse the repository at this point in the history
Docker configurations for servers.
  • Loading branch information
digisomni authored Sep 25, 2023
2 parents 185a3ad + 9b126cf commit f269a7d
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
50 changes: 50 additions & 0 deletions pkg-scripts/docker-compose-generation/Docker-compose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Running multiple containers

## _This is the instruction of how to establish seven containers to let them connect with each other using docker-compose command in a YAML file. (one domain server + six assignment clients)_


---
## _How to start the containers_

- clone the repo or single yaml file and jump into that directory.

- modify the following commands in the yaml file.

```
domain-server:
image: <image_name>
assignment-client:
image: <image_name>
```

- run the following command in your terminal.

```
docker-compose up -d --scale assignment-client=6
```

- after running the above command, check all running and stopped containers by typing (or you can find the containers on docker desktop if you have).

```
docker ps
```

```
docker ps -a
```

---

## _How to check the servers in the containers are operating properly_

- start vircadia and type localhost in explore app.

- type "localhost:40100" in your web explorer.

- you should see seven (or six) nodes by clicking Nodes on top.

---

## _Note: the other five assigment client containers have to be started manually either through terminal or docker desktop_
19 changes: 19 additions & 0 deletions pkg-scripts/docker-compose-generation/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# We need 7 containers in total, one domain server
# + six assignment clients
# -a 172.17.0.1

version: "3.8"
services:
domain-server:
image: james422481/vircadia_server:1
ports:
- "40100:40100/tcp"
- "40102:40102/udp"
command: /opt/vircadia/domain-server
assignment-client:
image: james422481/vircadia_server:1
ports:
- "40200-40205:40200/udp"
extra_hosts:
- "host.docker.internal:host-gateway"
command: /opt/vircadia/assignment-client -a host.docker.internal -p 40200 --server-port 40102 --disable-domain-port-auto-discovery
36 changes: 36 additions & 0 deletions pkg-scripts/docker-image-generation/Docker-image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Building the server image

## _This is the instruction of how to build the image that contains the domain-server and the assignment-clients (and the ice-server) using the Dockerfile_

---
## _How to build the image_

- clone the repo or the folder named "docker-image-generation" and jump into that directory.

- copy the .deb file into this folder and modify the following command in Dockerfile.

```
COPY <filename.deb>
```

- run the following command in your terminal (Ubuntu 20.04).

- make sure you assign a name to the image by replacing "image_name".

```
docker build -t <image_name> .
```

---

## _How to check the image is built successfully_

- run the following command (after starting docker desktop if you have).

```
docker image ls
```

- if the image is built properly, you should be able to find the image in the list.


6 changes: 6 additions & 0 deletions pkg-scripts/docker-image-generation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubuntu:20.04
COPY vircadia-server_2022.12.02-20221123-4ff3625-0ubuntu1-1_amd64.deb .
RUN apt update
RUN apt install libcap2-bin -y
RUN apt install systemd -y
RUN apt -y install ./vircadia-server_2022.12.02-20221123-4ff3625-0ubuntu1-1_amd64.deb

0 comments on commit f269a7d

Please sign in to comment.