This documentation covers the DevOps architecture and technologies used to deploy the Multi Theft Auto: San Andreas server in a containerized environment.
- Docker: Used to containerize the server, ensuring that the application runs identically regardless of the host machine's configuration.
- Docker Compose: Acts as the orchestrator to manage the service, networking, and volume mapping in a single configuration file.
- Ubuntu 22.04 (LTS): The lightweight base image used inside the container to provide a stable Linux environment.
- Infrastructure as Code (IaC): The entire server environment is defined by code (
Dockerfileanddocker-compose.yml), making it easy to replicate or migrate.
Instead of installing dependencies directly on the VPS, we use a custom Dockerfile. It handles the installation of specific Linux libraries required by the MTA binary (libreadline8, libncursesw6, and libsqlite3-0), keeping the host OS clean.
The docker-compose.yml file manages the container lifecycle. It defines:
- Port Mapping: Routes external traffic (UDP 22003, 22126 and TCP 22005) into the container.
- Restart Policy: Configured to
always, ensuring the server automatically restarts if the process crashes or the VPS reboots. - Detached Execution: Replaces the need for
screenortmuxby running the server as a background system daemon.
We utilize Docker Volumes to map the host's physical directory (mods/) to the containerโs internal path. This architecture allows for real-time script editing and ensures that all game data, logs, and internal databases are persisted even if the container is destroyed.
- Host OS: Linux (Ubuntu/Debian recommended).
- Runtime: Docker Engine 24.0+ & Docker Compose V2.
Status: โ Production Ready