From 1e33322bfc611ff6a600bbf0bac68547ad0494f1 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 5 Jul 2019 14:45:41 +0200 Subject: [PATCH] Initial commit --- .dockerignore | 5 +++++ CHANGELOG | 2 ++ CloudronManifest.json | 31 +++++++++++++++++++++++++++++++ DESCRIPTION.md | 1 + Dockerfile | 15 +++++++++++++++ start.sh | 13 +++++++++++++ traccar.xml.template | 26 ++++++++++++++++++++++++++ 7 files changed, 93 insertions(+) create mode 100644 .dockerignore create mode 100644 CHANGELOG create mode 100644 CloudronManifest.json create mode 100644 DESCRIPTION.md create mode 100644 Dockerfile create mode 100755 start.sh create mode 100644 traccar.xml.template diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c7688ce --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +.gitignore +.dockerignore +node_modules + diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..0b6ac06 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,2 @@ +[0.1.0] +* Initial version diff --git a/CloudronManifest.json b/CloudronManifest.json new file mode 100644 index 0000000..c60aea7 --- /dev/null +++ b/CloudronManifest.json @@ -0,0 +1,31 @@ +{ + "id": "org.traccar.coudronapp", + "title": "Traccar", + "author": "Traccar developers", + "description": "file://DESCRIPTION.md", + "changelog": "file://CHANGELOG", + "tagline": "One-line description", + "version": "0.1.0", + "healthCheckPath": "/", + "httpPort": 8082, + "addons": { + "ldap": {}, + "localstorage": {} + }, + "tcpPorts": { + "OSMAND_PORT": { + "title": "OsmAnd Port", + "description": "Port over which OsmAnd clients can connect", + "defaultValue": 5055 + } + }, + "manifestVersion": 1, + "website": "https://example.com", + "contactEmail": "support@cloudron.io", + "icon": "", + "tags": [ + "changeme" + ], + "mediaLinks": [] +} + diff --git a/DESCRIPTION.md b/DESCRIPTION.md new file mode 100644 index 0000000..ee63036 --- /dev/null +++ b/DESCRIPTION.md @@ -0,0 +1 @@ +Please add the appstore description in markdown format here. \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a158f33 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617 + +RUN mkdir -p /app/code +WORKDIR /app/code + +RUN wget https://github.com/traccar/traccar/releases/download/v4.5/traccar-linux-64-4.5.zip -O traccar.zip && \ + unzip traccar.zip && \ + ./traccar.run --target /app/code/ --noexec && \ + rm README.txt traccar.zip traccar.run + +RUN rm /app/code/conf/traccar.xml && ln -s /app/data/traccar.xml /app/code/conf/traccar.xml + +COPY start.sh traccar.xml.template /app/pkg/ + +CMD [ "/app/pkg/start.sh" ] diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..701bac9 --- /dev/null +++ b/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eu -o pipefail + +echo "=> Ensure traccar.xml config" +if [[ ! -f /app/data/traccar.xml ]]; then + cp /app/pkg/traccar.xml.template /app/data/traccar.xml +fi + +cd /app/code + +echo "=> Start traccar-server" +./jre/bin/java -jar tracker-server.jar ./conf/traccar.xml diff --git a/traccar.xml.template b/traccar.xml.template new file mode 100644 index 0000000..aab9ba3 --- /dev/null +++ b/traccar.xml.template @@ -0,0 +1,26 @@ + + + + + + + ./conf/default.xml + + + + org.h2.Driver + jdbc:h2:./data/database + sa + + +