From 384cf59541701ce6f9f11420598f1a7aa4484cba Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 11 Nov 2018 02:14:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BA=D0=B5=D1=80=20=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B7=20=D1=81=20TileOven?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 18 ++++++++++++++++++ README | 10 ++++++++++ config.json | 12 ++++++++++++ etc/apt/apt.conf | 4 ++++ etc/apt/sources.list | 1 + etc/locale.gen | 2 ++ etc/localtime | 1 + yaml2mml.py | 3 +++ 8 files changed, 51 insertions(+) create mode 100644 Dockerfile create mode 100644 README create mode 100644 config.json create mode 100644 etc/apt/apt.conf create mode 100644 etc/apt/sources.list create mode 100644 etc/locale.gen create mode 120000 etc/localtime create mode 100644 yaml2mml.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b3a95d5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM debian:sid + +MAINTAINER Vitaliy Filippov + +ADD etc /etc + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" \ + -o Dpkg::Options::="--force-confold" install -y wget git zip unzip mc locales less procps ca-certificates lsb-release \ + build-essential curl gnupg2 fontconfig fonts-noto && \ + (curl -sL https://deb.nodesource.com/setup_8.x | bash -) && \ + DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y nodejs && \ + apt-get -y clean + +RUN cd /home && mkdir data && git clone https://github.com/florianf/tileoven && cd tileoven && npm install + +ADD config.json /home/tileoven/config.json.tmpl + +CMD cd /home/tileoven && perl -pe 's/TILEOVEN_HOST/$ENV{TILEOVEN_HOST}/g' < config.json.tmpl > config.json && nodejs index.js --config=config.json diff --git a/README b/README new file mode 100644 index 0000000..44f4783 --- /dev/null +++ b/README @@ -0,0 +1,10 @@ +Сборка: + +docker build -t tileoven . + +Запуск: + +docker run --name tileoven -v tileoven:/home/data \ + -v /var/run/postgresql:/var/run/postgresql \ + -e TILEOVEN_HOST=your-host.ru \ + -p 20008:20008 -p 20009:20009 -t -d tileoven diff --git a/config.json b/config.json new file mode 100644 index 0000000..e7fb7d0 --- /dev/null +++ b/config.json @@ -0,0 +1,12 @@ +{ + "port": 20009, + "tilePort": 20008, + "tileUrl": "TILEOVEN_HOST:20008", + "files": "/home/data", + "examples": true, + "sampledata": true, + "host": "TILEOVEN_HOST", + "listenHost": "0.0.0.0", + "server": true, + "verbose": "on" +} diff --git a/etc/apt/apt.conf b/etc/apt/apt.conf new file mode 100644 index 0000000..68d79bf --- /dev/null +++ b/etc/apt/apt.conf @@ -0,0 +1,4 @@ +APT::Install-Suggests false; +APT::Install-Recommends false; +Acquire::Retries 5; +Binary::apt::APT::Keep-Downloaded-Packages "false"; diff --git a/etc/apt/sources.list b/etc/apt/sources.list new file mode 100644 index 0000000..3219967 --- /dev/null +++ b/etc/apt/sources.list @@ -0,0 +1 @@ +deb http://http.debian.net/debian/ sid main contrib non-free diff --git a/etc/locale.gen b/etc/locale.gen new file mode 100644 index 0000000..0c8fc3f --- /dev/null +++ b/etc/locale.gen @@ -0,0 +1,2 @@ +en_US.UTF-8 UTF-8 +ru_RU.UTF-8 UTF-8 diff --git a/etc/localtime b/etc/localtime new file mode 120000 index 0000000..bca5165 --- /dev/null +++ b/etc/localtime @@ -0,0 +1 @@ +/usr/share/zoneinfo/Europe/Moscow \ No newline at end of file diff --git a/yaml2mml.py b/yaml2mml.py new file mode 100644 index 0000000..6fb26c3 --- /dev/null +++ b/yaml2mml.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python +import sys, yaml, json +json.dump(yaml.safe_load(sys.stdin), sys.stdout, indent=2)