How to run the LS on your system.
This section explains how to set up the Lobby Service on your system, using Docker. At the end you will find instructions for advanced users on how to integrate a gameserver into a prepared docker-compose configuration.
Clone this repository with either https
, ssh
or the direct download as zip
.
- First option:
git clone https://github.com/kartoffelquadrat/LobbyService.git
- Or click on the download button, then extract the zip file.
Install the following software on your machine:
- JDK-8 or higher.
Verify system JDK version:java -version
- Maven
- Docker
- Create a docker container from the provided
Dockerfile
.
docker build -t "ls-db:Dockerfile" . -f Dockerfile-ls-db
docker run --name=ls-db -p 3453:3306 -d ls-db:Dockerfile
Note: Creation and deployment by Dockerfile is only required the first time!
Usedocker start ls-db
from here on.
- Power up the LS REST-API backend:
cd LobbyService
mvn clean spring-boot:run
-
Verify the LS is reachable
- Open a browser
- Visit http://127.0.0.1:4242/api/online
You should seeLobby-Service platform is happily serving 5 users.
-
Verify DB access:
mysql -h 127.0.0.1 -P 3453 --protocol=tcp -u ls -pphaibooth3sha6Hi
> USE ls;
> SELECT * FROM player;
(Make sure the five default users are listed)
The advanced setup builds and deploys the entire LS and provided GameServers as a Microservice.
Disclaimer: You will have to create a corresponding entry in
docker-compose.yml
and an extraDockerfile
for each integrated Game-Server.
This setup is intended for deployment on production servers, not for game developers.
-
Reconfigure the REST api's DB-access to use a virtual network:
- Open
src/main/resources/application.properties
. - Toggle the DB connection entries. (
spring.datasource.url=...
)
- Open
-
Add a service entry for each of your Game-Services in:
docker-compose.yml
. Write a correspondingDockerfile
for each service.
- Power up the microservice:
cd LobbyService
docker-compose up
-
Make sure the API backend is reachable:
curl -X GET http://127.0.0.1:4242/api/online
-
Test API access -> Must display:
Lobby-Service platform is happily serving 5 users.