Compare commits
3 Commits
f568db0ffb
...
main
Author | SHA1 | Date | |
---|---|---|---|
b8b89ef56e | |||
472554d264 | |||
90afffb41c |
@@ -13,7 +13,7 @@ When everything's ready start Traccar with Docker Compose, otherwise head down t
|
|||||||
export COMPOSE_DIR='/opt/containers/traccar'
|
export COMPOSE_DIR='/opt/containers/traccar'
|
||||||
export COMPOSE_CTX='ux_vilnius'
|
export COMPOSE_CTX='ux_vilnius'
|
||||||
export COMPOSE_PROJECT='traccar-'"${COMPOSE_CTX}"
|
export COMPOSE_PROJECT='traccar-'"${COMPOSE_CTX}"
|
||||||
export COMPOSE_FILE="${COMPOSE_DIR}"'/docker-compose.yml'
|
export COMPOSE_FILE="${COMPOSE_DIR}"'/compose.yaml'
|
||||||
export COMPOSE_ENV=<add accordingly>
|
export COMPOSE_ENV=<add accordingly>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ docker context create fully.qualified.domain.name --docker 'host=ssh://root@full
|
|||||||
Pull both Traccar and MySQL:
|
Pull both Traccar and MySQL:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker compose --project-name "${COMPOSE_PROJECT}" --file "${COMPOSE_FILE}" --env-file "${COMPOSE_ENV}" --profile 'full' pull
|
docker --project-name "${COMPOSE_PROJECT}" --file "${COMPOSE_FILE}" --env-file "${COMPOSE_ENV}" --profile 'full' pull
|
||||||
```
|
```
|
||||||
|
|
||||||
## Copy to target
|
## Copy to target
|
||||||
|
4
build-context/mysql/Dockerfile
Normal file
4
build-context/mysql/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
ARG MYSQL_VERSION
|
||||||
|
|
||||||
|
FROM "mysql:${MYSQL_VERSION}"
|
||||||
|
RUN mkdir -p /tmp/mysql
|
0
build-context/mysql/docker-data/.gitkeep
Normal file
0
build-context/mysql/docker-data/.gitkeep
Normal file
5
build-context/mysql/docker-data/config/db/my.cnf
Normal file
5
build-context/mysql/docker-data/config/db/my.cnf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[mysqld]
|
||||||
|
innodb_buffer_pool_size = 512M
|
||||||
|
innodb_redo_log_capacity = 512M
|
||||||
|
innodb_flush_method = O_DIRECT
|
||||||
|
innodb_flush_log_at_trx_commit = 0
|
0
build-context/mysql/extras/.gitkeep
Normal file
0
build-context/mysql/extras/.gitkeep
Normal file
14
build-context/traccar/Dockerfile
Normal file
14
build-context/traccar/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# For the remainder of this Dockerfile EXAMPLE_ARG_FOR_DOCKERFILE will be
|
||||||
|
# available with a value of 'must_be_available_in_dockerfile', check out the env
|
||||||
|
# file at 'env/fully.qualified.domain.name.example' for reference.
|
||||||
|
# ARG EXAMPLE_ARG_FOR_DOCKERFILE
|
||||||
|
|
||||||
|
# Another env var, this one's needed in the example build step below:
|
||||||
|
# ARG TRACCAR_VERSION
|
||||||
|
|
||||||
|
# Example
|
||||||
|
# FROM "traccar:${TRACCAR_VERSION}"
|
||||||
|
# RUN apt-get update && \
|
||||||
|
# apt-get -y install \
|
||||||
|
# somepackage-6.q16-6-extra && \
|
||||||
|
# rm -rf /var/lib/apt/lists/*
|
0
build-context/traccar/docker-data/.gitkeep
Normal file
0
build-context/traccar/docker-data/.gitkeep
Normal file
26
build-context/traccar/docker-data/config/traccar.xml
Normal file
26
build-context/traccar/docker-data/config/traccar.xml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
|
||||||
|
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
|
||||||
|
<entry key='config.default'>./conf/default.xml</entry>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
This is the main configuration file. All your configuration parameters should be placed in this file.
|
||||||
|
|
||||||
|
Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
|
||||||
|
with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
|
||||||
|
remove "config.default" parameter from this file unless you know what you are doing.
|
||||||
|
|
||||||
|
For list of available parameters see following page: https://www.traccar.org/configuration-file/
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
|
||||||
|
<entry key='database.url'>jdbc:mysql://mysql/traccar?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
|
||||||
|
<entry key='database.user'>traccar</entry>
|
||||||
|
<entry key='database.password'>t0psecret</entry>
|
||||||
|
|
||||||
|
</properties>
|
0
build-context/traccar/docker-data/data/.gitkeep
Normal file
0
build-context/traccar/docker-data/data/.gitkeep
Normal file
0
build-context/traccar/extras/.gitkeep
Normal file
0
build-context/traccar/extras/.gitkeep
Normal file
@@ -8,4 +8,4 @@ services:
|
|||||||
max-size: "10m"
|
max-size: "10m"
|
||||||
max-file: "10"
|
max-file: "10"
|
||||||
compress: "true"
|
compress: "true"
|
||||||
restart: "${RESTARTPOLICY:-unless-stopped}"
|
restart: "${RESTARTPOLICY:-always}"
|
@@ -11,7 +11,7 @@ services:
|
|||||||
soft: ${ULIMIT_NPROC-65535}
|
soft: ${ULIMIT_NPROC-65535}
|
||||||
hard: ${ULIMIT_NPROC-65535}
|
hard: ${ULIMIT_NPROC-65535}
|
||||||
extends:
|
extends:
|
||||||
file: common-settings.yml
|
file: common-settings.yaml
|
||||||
service: common-settings
|
service: common-settings
|
||||||
ports:
|
ports:
|
||||||
- "${TRACCAR_WEBUI_PORT}:8082"
|
- "${TRACCAR_WEBUI_PORT}:8082"
|
||||||
@@ -35,15 +35,14 @@ services:
|
|||||||
soft: ${ULIMIT_NPROC-65535}
|
soft: ${ULIMIT_NPROC-65535}
|
||||||
hard: ${ULIMIT_NPROC-65535}
|
hard: ${ULIMIT_NPROC-65535}
|
||||||
extends:
|
extends:
|
||||||
file: common-settings.yml
|
file: common-settings.yaml
|
||||||
service: common-settings
|
service: common-settings
|
||||||
ports:
|
ports:
|
||||||
- "${MYSQL_PORT}:3306"
|
- "${MYSQL_PORT}:3306"
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/docker-data/traccar-${CONTEXT}/mysql/config/db:/etc/mysql/conf.d
|
- /opt/docker-data/traccar-${CONTEXT}/mysql/config/db:/etc/mysql/conf.d
|
||||||
- /opt/docker-data/traccar-${CONTEXT}/mysql/config/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
|
- /opt/docker-data/traccar-${CONTEXT}/mysql/config/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
|
||||||
- /opt/docker-data/traccar-${CONTEXT}/mysql/data/datadir:/var/lib/mysql
|
- /opt/docker-data/traccar-${CONTEXT}/mysql/data:/var/lib/mysql
|
||||||
- /opt/docker-data/traccar-${CONTEXT}/mysql/data/tmpdir:/tmp/mysql
|
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
@@ -1,17 +0,0 @@
|
|||||||
services:
|
|
||||||
traccar-build:
|
|
||||||
image: "traccar/traccar:${TRACCAR_VERSION}"
|
|
||||||
profiles: ["build", "build-traccar"]
|
|
||||||
build:
|
|
||||||
context: "build-context/traccar"
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
args:
|
|
||||||
TRACCAR_VERSION: "${TRACCAR_VERSION}"
|
|
||||||
mysql-build:
|
|
||||||
image: "mysql:${MYSQL_VERSION}"
|
|
||||||
profiles: ["build", "build-mysql"]
|
|
||||||
build:
|
|
||||||
context: "build-context/mysql"
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
args:
|
|
||||||
MYSQL_VERSION: "${MYSQL_VERSION}"
|
|
Reference in New Issue
Block a user