Run L2J server and it's CLI using Docker.
After running the setup, you will have:
- a login server with it's own database and the CLI available
- a game server with it's own database
Why separated? This way you can have the login server in one machine and the game server in other so the login server doesn't consume resources from the game server.
Initial container build
cd login
docker-compose build
Start MariaDB with docker-compose up db
Once the previous command finishes (it should print mysqld: ready for connections.
)
open up a new terminal and create the database
docker-compose run --rm cli
db install -sql login/sql -t LOGIN -c -mods -m FULL
> Seems database already exists, do you want to continue installing? (y/N): y
quit
And now we can start the login server with docker-compose up
Initial container build
cd game
docker-compose build
Start MariaDB with docker-compose up db
Once the previous command finishes (it should print mysqld: ready for connections.
)
open up a new terminal and create the database
docker-compose run --rm cli
db install -sql game/sql -t GAME -c -mods -m FULL
> Seems database already exists, do you want to continue installing? (y/N): y
quit
Start game server with docker-compose up
Simply start the servers with cd login && docker-compose up -d
and
cd game && docker-compose up -d
. This will leave both servers running in
background
All the services will restart automatically in case of failure.
If you need to attach configuration or custom files, you can do so using volumes. Check login/docker-compose.yml:
volumes:
- "./config:/usr/loginserver/config"
In this case, we are overwriting the configuration with whatever
we got on ./config