Sign inSign up

dankrr/tf2autobotmultiarch

By dankrr

•Updated over 3 years ago

TF2 Autobot but built with with buildx for several different architectures.

Image
0

772

dankrr/tf2autobotmultiarch repository overview

⁠Use Cases

Minimal Ops Knowledge With tf2autobot on Docker, you can learn quickly how to power up a bot without problems and with minimal sysadmin/ops knowledge. You just install Docker and run a command in the terminal and your bot is live. With this newly compiled fork, you can run it on several types of architectures not just linux/amd64.

⁠Running in Kubernetes

For advanced users, you can orchestrate multiple bots dynamically, both network and workload, using Kubernetes. It can be scheduled as Pod or a StatefulSet replica with 1 replica.

⁠Running a container

Starting with tf2autobot v3.5.0, Docker images are available and you can run the latest, lightweight version of tf2autobot (we recommend using a specific version to avoid breaks):

$ docker run dankrr/tf2autobotmultiarch:latest Congrats! You have created your first tf2autobot container that runs, but is not configured and might throw errors. Follow the instructions to know how to persist the data and how to configure the container.

⁠Persisting the data

The only downside of tf2autobot on Docker is that you need to persist data between your operating system and the container. If you run the container and then you stop it, your ~/tf2autobot/files/<STEAM_ACCOUNT_NAME>/ folder created within the container will no longer exist and will be re-regenerated every time.

To overcome this, we will tell the container to mount a volume at the ~/tf2autobot/files/<STEAM_ACCOUNT_NAME>/ folder with a given path in our operating system (like on Desktop for example).

You can use the -v flag to specify a mirror between a local path (the path in your PC or on the server) and the container path (which should be, obviously, ~/tf2autobot/files/<STEAM_ACCOUNT_NAME>/).

We assume the following example, running the command while you're on Desktop and tf2autobot_data/123456/ folder exists, and the account name is 123456:

$ docker run
-v $(pwd)/tf2autobot_data/123456:/home/node/tf2autobot/files/123456
dankrr/tf2autobotmultiarch:latest Make sure to replace 123456 with your account name, as explained in the configuration docs.

The $(pwd) at the start of the pathname tells Docker to look for the current context - the current folder we run the command from.

Every time the container or you will (manually) change files within ~/tf2autobot/files/123456/, they will persist and you can keep using the bot without fearing the configuration will get lost.

⁠Configure the container

⁠Environment variables

The recommended way of configuring the container is by using environment variables. In Docker, you can attach environment variables at runtime by using the -e flag:

$ docker run
-v $(pwd)/tf2autobot_data/123456:/home/node/tf2autobot/files/123456
-e STEAM_ACCOUNT_NAME=some-account-name
-e STEAM_PASSWORD=mysecurepassword
-e STEAM_SHARED_SECRET="agdgwegdgawfagxafagfkagusbuigiuefh=="
dankrr/tf2autobotmultiarch:latest The environment variables are identical to the ones specified in the example .env file.

⁠ecosystem.json

According to the configuration docs, you will need to persist an ecosystem.json file in ~/tf2autobot to configure multiple bots. Like we learned how to persist the data with the tf2autobot_data folder, we can as well persist files:

$ docker run
-v $(pwd)/tf2autobot_data/123456:/home/node/tf2autobot/files/123456
-v $(pwd)/tf2autobot_data/ecosystem.json:/home/node/tf2autobot/ecosystem.json
dankrr/tf2autobotmultiarch:latest

⁠.env

Just like ecosystem.json, you can as well configure an .env file:

$ docker run
-v $(pwd)/tf2autobot_data/123456:/home/node/tf2autobot/files/123456
-v $(pwd)/tf2autobot_data/.env:/home/node/tf2autobot/.env
dankrr/tf2autobotmultiarch:latest

⁠Running multiple bots

It's highly recommended to run one bot per container to keep the Docker base consistency guidelines. You can however go ahead and configure the ecosystem.json file and have more than one bot per container, but you will need to configure more volumes to mount:

$ docker run
-v $(pwd)/tf2autobot_data/11111:/home/node/tf2autobot/files/11111
-v $(pwd)/tf2autobot_data/22222:/home/node/tf2autobot/files/22222
-v $(pwd)/tf2autobot_data/ecosystem.json:/home/node/tf2autobot/ecosystem.json
dankrr/tf2autobotmultiarch:latest

Tag summary

Content type

Image

Digest

sha256:f2f29404e…

Size

178.4 MB

Last updated

over 3 years ago

docker pull dankrr/tf2autobotmultiarch