Skip to content

altmp/altv-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt:V server Docker image

Docker images to easily deploy your alt:V game and voice servers

Docker Hub (game server) ↗Docker Hub (voice server) ↗Got an issue?


Usage

To start a minimal game server run:

docker run --rm -it -p 7788:7788 -p 7788:7788/udp altmp/altv-server:release

To start a minimal voice server run:

docker run --rm -it -p 7799:7799/udp altmp/altv-voice-server:release

To start server with voice using Docker Compose see example docker-compose.yml file (replace your.public.ip with your public IP).

Configuration

The alt:V server is located at the path /altv inside the Docker container.

Server settings

There are two ways to specify server configurations:

Configuration via environment variables

This image allows you to set all existing server settings by specifying environment variables. All variables follow the syntax ALTV_SETTING_NAME, for a complete list of options look at the game server setup script or voice server setup script.

In case of array values (arr('...')) specify a comma separated string.
In case of boolean values (bool('...')) specify true, yes, y or 1 for true, or false, no, n, or 0 for false.
In case of JSON values (jsonObj('...')) specify a valid JSON object

Example:

docker run --rm -it \
    -p 7788:7788 -p 7788:7788/udp \
    -e ALTV_PLAYERS=100 -e ALTV_DEBUG=true \
    altmp/altv-server:release

Configuration via volumes

You can provide your own config file to configure your server. To do this, mount the file to /altv/server.toml (or /altv/voice.toml for voice server) and specify the environment variable ALTV_USE_ENV_CONFIG=false.

Example:

docker run --rm -it \
    -p 7788:7788 -p 7788:7788/udp \
    -v ./server.toml:/altv/server.toml \
    -e ALTV_USE_ENV_CONFIG=false \
    altmp/altv-server:release

Arguments

Arguments of the Docker image get passed directly to altv-server or altv-voice-server. See CLI arguments ↗ for more info.

Example:

docker run --rm -it \
    -p 7788:7788 -p 7788:7788/udp \
    altmp/altv-server:release \
    --convert-config-format

Resources

If server is configured using environment variables by default the Docker image loads all resources located in /altv/resources. You can override this behavior by specifying custom resources array via configuration.

Example:

docker run --rm -it \
    -p 7788:7788 -p 7788:7788/udp \
    -v ./resources:/altv/resources \
    -e ALTV_RESOURCES=resource1,resource2 \
    altmp/altv-server:release

Modules

By default, this image includes JS Module ↗ and C# Module ↗.
Tags that contain -js (e.g. release-js or 16-dev-js) include JS Module ↗ only, for smaller image size.
On release branch this image also includes JS Bytecode Module ↗.

To load custom modules add them to /altv/modules, and specify custom modules array via configuration.

Example:

docker run --rm -it \
    -p 7788:7788 -p 7788:7788/udp \
    -v ./my-module.so:/altv/modules/my-module.so \
    -e ALTV_MODULES=js-module,csharp-module,my-module \
    altmp/altv-server:release

Usage as a base image

In a lot of cases it will be much more convinient to create your own Dockerfile, that is using this image as a base. This way you can modify every part of the server, include your resources, setup configuration, etc.

Example:

FROM altmp/altv-server:release

ENV ALTV_NAME="My cool server"
ENV ALTV_DEBUG=true

COPY my-cool-resource /altv/resources/my-cool-resource

Special thanks

Special thanks to @pixlcrashr at @eisengrind who created and has been maintaining the unofficial alt:V server Docker image ↗.

License

See LICENSE for more information.