Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 3.01 KB

RunningDockerImage.md

File metadata and controls

104 lines (78 loc) · 3.01 KB

Running the Project Apollo Docker Image

Docker Image

To create your own Docker image, the process is:

git clone https://github.com/kasenvr/project-apollo.git
cd project-apollo/docker
docker build -t vircadiamvsrv .

I have been running the Docker image in a DigitalOcean droplet. The process I use has the following steps:

  1. Create the droplet
  2. Log into the droplet as root
  3. Create a new user in the droplet to run the metaverse-server
  4. Log into the new user account in the droplet
  5. Create directories to hold the persistant data and logs
  6. Create configuration file for the metaverse-server
  7. Start the Docker image

Each of these steps are described below.

One also needs to set up some domain names for use by the droplet so you are not dealing with ever changing IP addresses. This is discussed below.

I've also been running the ice-server in a droplet. This process is described in RunningIceServer.

Create and Log Into Droplet

Follow the instructions at DigitalOcean to create and access a droplet.

Create New User In Droplet

I create a new user in the droplet to run the metaverse-server so the server is not running as root. I copy the SSH key from the root account to this new account so the SSH login is the same.

adduser --disabled-password --gecos "Vircadia Metaverse Server User" mvsrv
mkdir /home/mvsrv/.ssh
cp /home/root/.ssh/authorized_keys /home/mvsrv/.ssh
chown -R mvsrv:mvsrv /home/mvsrv/.ssh
chmod 700 /home/mvsrv/.ssh

Create Directories for Persistant Data and Create Configuration File

mkdir -p content/Config
cat > content/Config/config.json << EOFFF
{
    "Storage.Dir": "/var/vircadia/content/Entries",
    "Logger.LogDirectory": "/var/vircadia/content/Logs",
    "DefaultIceServer": THE_ADDRESS_OF_ICE_SERVER,

    "LogLevel": "Debug",
    "Logger.ForceFlush": true,
    "ConsoleLog": false,
    "Debug.Processing": true
}
EOFFF

This configuration file points the metaverse-server's storage to the created directory and sets up logging to be verbose. The ConsoleLog setting to false says to not log to the console and let all logging go to the content/Logs directory.

The THE_ADDRESS_OF_ICE_SERVER must be replaced with the IP address or domain name of the ice-server.

The last three lines says "Debug" level logging, flush write each log file entry (this helps make sure information is in the log file if the application crashes), and to output a debug log line when any API call is received.

Run the Metaverse-Server Docker Image

I use a script to run the docker image:

#! /bin/bash

docker run -d \
        --restart=unless-stopped \
        -p 9400:9400 \
        --volume /home/mvsrv/content/:/var/vircadia/content \
        misterblue/vircadia-metaverse-server

If you change the port in the configuration file, remember to change the -p parameter above.