tileserver: new role to serve map tile

This commit is contained in:
Markus 2020-06-17 20:44:52 +02:00
parent 88e2c60888
commit e7b55ce809
7 changed files with 3558 additions and 1 deletions

View File

@ -14,4 +14,4 @@
- docker-ce - docker-ce
- docker-ce-cli - docker-ce-cli
- containerd.io - containerd.io
- docker-compose - python-docker

View File

@ -0,0 +1,31 @@
{
"options": {
"paths": {
"root": "/usr/src/app/node_modules/tileserver-gl-styles",
"fonts": "fonts",
"styles": "/data/styles",
"mbtiles": "/data"
},
"formatQuality": {
"jpeg": 80,
"webp": 90
}
},
"styles": {
"day": {
"style": "day.json",
"tilejson": {
}
},
"night": {
"style": "night.json",
"tilejson": {
}
}
},
"data": {
"v3": {
"mbtiles": "tiles.mbtiles"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
---
- name: Restart tileserver
docker_container:
name: tileserver
image: maptiler/tileserver-gl
interactive: yes
ports:
- "80:80"
- "8080:8080"
restart: yes
restart_policy: unless-stopped
state: started
tty: yes
volumes:
- "/opt/tileserver:/data"

View File

@ -0,0 +1,33 @@
---
- name: Create data directories
file:
path: "{{ item }}"
state: directory
with_items:
- /opt/tileserver
- /opt/tileserver/styles
- name: Configre tileserver
copy:
src: "{{ item }}"
dest: /opt/tileserver/{{ item }}
with_items:
- config.json
- styles/day.json
- styles/night.json
notify: Restart tileserver
- name: Run tileserver container
docker_container:
name: tileserver
image: maptiler/tileserver-gl
interactive: yes
ports:
- "80:80"
- "8080:8080"
restart_policy: unless-stopped
state: started
tty: yes
volumes:
- "/opt/tileserver:/data"

View File

@ -41,3 +41,8 @@
hosts: [unms.ffrgb, unifi.ffrgb, tiles.ffrgb] hosts: [unms.ffrgb, unifi.ffrgb, tiles.ffrgb]
roles: roles:
- docker - docker
- name: Setup tile server
hosts: tiles.ffrgb
roles:
- tileserver