- Push to branch
main
- Wait for action to build package & web server to run container
- View at https://distr-sys-io.ivo-zilkenat.de/
docker
ansible
python3-dotenv-cli
git
(pre-installed on many Linux distros)make
(pre-installed on many Linux distros)
- Clone project
- Configure environment variables
cp local.env ./deployment/.env
(e.g.DOMAIN
, ...) cd
into./deployment
directory- Join docker swarm cluster
- If not cluster present, create one and use current machine as master node:
docker swarm init --advertise-addr 127.0.0.1´
- If not cluster present, create one and use current machine as master node:
Deploy using local container (e.g. your code changes in game_server or app_matchmaking_host):
- Please use the images and domain environmental variables as listed in localhost.env in your deployment/.env file
- Then run
make deploy-local
Deploy
- Run
make deploy
Undeployment
- Run
make rm-all
Scaling
- Add lobby
make lobby_id=your_name_here add-lobby
Run database:
- Go into services/database
- Run
docker compose up
Run the matchmaking server:
- Go into services/app_matchmaking_host
- Activate venv (e.g. with
source backend/venv/bin/activate
) - Run server with
python main.py
Run a game server:
- Go into services/game_server
- Activate venv (e.g. with
source venv/bin/activate
) - Optional: Customize environment variables (with
export {VARIABLE_NAME}={VARIABLE_VALUE}
)DEPEND_ON_MATCHMAKING
: Set to 0 if you want the game server to start without the matchmaking serverHOST
: Host name of the Server, defaults to 0.0.0.0, but could (should) belocalhost
for examplePORT
: Port of the Server, defaults to 3001SERVER_NAME
: Name of the lobby which gets sent to the app_matchmaking_host, defaults toUnbekannt
SERVER_URL
: The url of the lobby which gets sent to the app_matchmaking_host, defaults tohttp://{HOST}:{PORT}
- Credentials
SERVER_ID
andSERVER_TOKEN
, not set by default Only use these, if you want to re log into the matchmaking_server, you probably do not need them. CREDENTIALS_FILE
: The file where credentials are saved to, defaults toDATA_DIR/credentials.json
- Run server with
python main.py