forked from OpenHistoricalDataMap/MapnikTileServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
143 lines (133 loc) · 3.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
143 lines (133 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
version: '3.4'
services:
# ssl proxy - let's encrypt
# https://docs.traefik.io/user-guide/docker-and-lets-encrypt/
traefik:
image: traefik
restart: always
# command: --help for all traefik commands
command: >
--docker.domain=${HOSTNAME}
--acme.storage=/acme.json
--acme.email=${ACME_EMAIL}
ports:
- 80:80 # HTTP port
- 443:443 # HTTPS port
- 8080:8080
networks:
- web
- intern
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./proxy/trefik.toml:/traefik.toml
container_name: traefik
labels:
- "traefik.docker.network=web"
# adminer -> like phpmyadmin for mariadb
# https://github.com/TimWolla/docker-adminer
adminer-db:
image: adminer
restart: always
depends_on:
- postgis
- traefik
command: php -S 0.0.0.0:8080 -t /var/www/html
networks:
- web
- intern
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.basic.frontend.rule=Host:db-admin.${HOSTNAME}"
- "traefik.basic.protocol=http"
# postgres database with PostGIS
# https://github.com/kartoza/docker-postgis
postgis:
image: kartoza/postgis:9.6-2.4 # Provides PostgreSQL 9.6, PostGIS 2.4
volumes:
- pgdata:/var/lib/postgresql/data
restart: always
networks:
- intern
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: gis
POSTGRES_MULTIPLE_EXTENSIONS: postgis,hstore,postgis_topology # You can pass as many extensions as you need.
# webserver for deploying static website
webserver:
image: nginx:latest
depends_on:
- traefik
- tile_server
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./website:/usr/share/nginx/html
networks:
- intern
- web
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.basic.frontend.rule=Host:www.${HOSTNAME},${HOSTNAME}"
- "traefik.basic.protocol=http"
# Ubuntu 18.04 with mapnik, carto, openstreetmap-carto & flask-mircoservice to serve & render tiles
# inspired by - https://ircama.github.io/osm-carto-tutorials/tile-server-ubuntu/
# - https://github.com/zavpyj/osm-tiles-docker
# - https://switch2osm.org/manually-building-a-tile-server-16-04-2-lts/
tile_server:
build:
context: ./tile_server
args:
CARTO_VERSION: 0 # carto version 0.x
OSM_CARTO_VERSION: v4.21.0 # version of https://github.com/gravitystorm/openstreetmap-carto/releases
restart: always
volumes:
- ./tile_server/app:/app
depends_on:
- postgis
- redis
- traefik
networks:
- intern
environment:
# Postgres Enviroment Vars https://www.postgresql.org/docs/current/libpq-envars.html
PGUSER: ${POSTGRES_USER}
PGPASSWORD: ${POSTGRES_PASSWORD}
PGDATABASE: gis
PGHOST: postgis
ServerName: ${HOSTNAME}
DEBUG: ${DEBUG}
CACHE: ${CACHE}
CAHCE_EXPIRE_TIME: ${CAHCE_EXPIRE_TIME}
STYLE_PATH: "/opt/openstreetmap-carto/"
import:
build:
context: ./import
args:
OSM_IMPORT_CACHE: 40 # osm2pgsql import cache size in MB
CARTO_VERSION: 0 # carto version 0.x
volumes:
- ./pbf:/opt/pbf
- ./import/update.sql:/update.sql
depends_on:
- postgis
networks:
- intern
environment:
PGUSER: ${POSTGRES_USER}
PGPASSWORD: ${POSTGRES_PASSWORD}
PGDATABASE: gis
PGHOST: postgis
redis:
image: "redis:alpine"
restart: always
networks:
- intern
networks:
web:
external: true
intern:
external: false
volumes:
pgdata: