Running the server as a docker container
-
Add an isolated network to share between the server and the database:
docker network create spacebar-network -
Set up a database for the server:
docker run \ -d \ --name spacebar-db \ --network spacebar-network \ -e POSTGRES_PASSWORD=postgres \ -v spacebar-db:/var/lib/postgresql \ postgres:alpine -
Run the server docker image to let it generate the config:
docker run \ --rm \ --name spacebar-server \ --network spacebar-network \ -e DATABASE=postgres://postgres:postgres@spacebar-db/postgres \ -e CONFIG_PATH=config.json \ -v ./data:/data \ ghcr.io/spacebarchat/server -
Set config values for
general_serverName,cdn_endpointPublic,cdn_endpointPrivatetohttp://localhost:3001,api_endpointPublictohttp://localhost:3001/api/v9andgateway_endpointPublictows://localhost:3001 -
Run the server docker image after the config changes:
docker run \ --name spacebar-server \ --network spacebar-network \ -e DATABASE=postgres://postgres:postgres@spacebar-db/postgres \ -e CONFIG_PATH=config.json \ -v ./data/:/data \ -p 3001:3001 \ ghcr.io/spacebarchat/server