Docker

Requirements

Build

At project root folder run:

sh ./setup/docker/build.sh

Running Container

Replace [VERSION] with project version from pom.xml. When providing custom config, always include bellow statement, since the included web folder is not minified.

<entry key='web.debug'>true</entry>

Running with internal H2 database and debug.xml:

docker run -d --name traccar-server -p 5000-5150:5000-5150 -p 8082:8082 tananaev/traccar:[VERSION]

Running with external config file:

docker run -d --name traccar-server -v /folder/myconfig.xml:/opt/traccar/traccar.xml -p 5000-5150:5000-5150 -p 8082:8082 tananaev/traccar:[VERSION]

Running with host folder mapped to container database folder:

docker run -d --name traccar-server -v /my-database-folder:/opt/traccar/data/database -p 5000-5150:5000-5150 -p 8082:8082 tananaev/traccar:[VERSION]

Running with external mysql instance (use MySQL config):

docker run -d --name traccar-server docker -p 8082:8082 tananaev/traccar:[VERSION]

Running along with mysql dockenized instance (use MySQL config):

docker run -d --name mysql-traccar -e MYSQL_DATABASE=traccar -e MYSQL_USER=traccar -e MYSQL_PASSWORD=my-secret-pw -e MYSQL_ROOT_PASSWORD=my-root-secret-pw mysql:5.6.30
docker run -d --name traccar-server docker --link mysql-traccar:mysql-traccar -p 8082:8082 tananaev/traccar:[VERSION]