This project sets up a cluster of SuperTuxKart servers with NGINX as a load balancer using Docker Compose. It includes secure handling of login credentials using Docker secrets.
- Docker
- Docker Compose
- sqlite3
First, create Docker secrets for your SuperTuxKart login credentials. Replace your_login
and your_password
with your actual SuperTuxKart login and password.
echo "your_login" | docker secret create stk_login -
echo "your_password" | docker secret create stk_password -
Clone this repository to your local machine:
git clone https://github.com/allthingslinux/atl-stk-loadhandler
cd atl-stk-loadhandler
This file is the database for banned users. Run the following commands to set it up:
sqlite3 bans.db "CREATE TABLE IF NOT EXISTS bans (id INTEGER PRIMARY KEY, username TEXT NOT NULL UNIQUE);"
The NGINX container uses the configuration specified in dockerfile.nginx
. It is set up for round-robin load balancing across the three SuperTuxKart servers.
The docker-compose.yml
file includes the definitions for the SuperTuxKart servers and the NGINX load balancer. You can modify this file to adjust port mappings and other settings.
The SuperTuxKart servers are configured using the server_config.xml
file. You can modify this file to change the server settings as needed.
Use Docker Compose to build the containers:
docker-compose build
This will build the images and start three SuperTuxKart servers along with an NGINX container for load balancing.
Start the servers using Docker Compose:
docker-compose up -d
After starting the containers, the SuperTuxKart servers will be accessible on the following ports:
stk-server1
:http://localhost:5001
stk-server2
:http://localhost:5002
stk-server3
:http://localhost:5003
NGINX will balance the load across these servers on port 2759
:
NGINX Load Balancer
:http://localhost:2759
To stop the containers, use the following command:
docker-compose down
This will stop and remove the containers while preserving the Docker secrets.
- Build Failures: Ensure that all necessary dependencies are installed and that the Docker secrets are correctly created.
- Configuration Issues: Verify that the
server_config.xml
andbans.db
files are correctly placed and formatted.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.
Contributions are welcome! Please create a pull request or open an issue to discuss any changes or improvements.
For any questions or support, please contact @tyttggfdsddgh
in the https://discord.gg/linux via a ticket, which you can create with the /ticket
command in any channel of the server.