Skip to content

Commit

Permalink
Postile test #1
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Apr 6, 2020
1 parent bd03145 commit 620c9af
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,10 @@ Random order tiles request on mixed urban and rural area, without concurrency. T
| Zoom 13, mixte Europe | 49 ms |
| Zoom 14, mixte Europe| 60 ms |
| Zoom 14, urban Paris | 250 ms |
| From cache | 5 ms |
| From cache | 5 ms |



docker build -t oslandia/postile:0.2-local .


11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
version: '2.1'

services:
postile:
image: oslandia/postile:0.2-local
command: postile --pguser openmaptiles --pgpassword openmaptiles --pgdatabase openmaptiles --pghost postgres --listen-port 80 --cors --tm2 /tm2/openmaptiles.tm2source/data.yml --listen 0.0.0.0
volumes:
- ./openmaptiles/build:/tm2
networks:
- openmaptiles_conn
ports:
- "8050:80"

tileserver-gl:
build:
context: tileserver-gl/tileserver-gl
Expand All @@ -19,6 +29,7 @@ services:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./cache:/cache
- ./openmaptiles/data/expire_tiles:/data/expire_tiles
- ./tilejson.json:/tilejson/tilejson/v3.json
networks:
- openmaptiles_conn
ports:
Expand Down
15 changes: 9 additions & 6 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ http {
limit_req_zone $binary_remote_addr zone=user_tile_rate_limit:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=user_other_rate_limit:10m rate=20r/s;

upstream postserve {
server postserve:8090 max_conns=128;
upstream postile {
server postile max_conns=128;
}

upstream tileserver-gl {
Expand Down Expand Up @@ -48,14 +48,17 @@ http {
limit_req zone=user_tile_rate_limit burst=30 nodelay;
}

location ~ /tilejson/v3.json {
root /tilejson/;
}

# Vector tile, tilejson
rewrite ^/data/v3/([0-9]+/[0-9]+/[0-9]+\.pbf)$ /data/v3/tiles/$1 last;
location ~ /data/v3/(?<postserve_path>.*)$ {
proxy_pass http://postserve/$postserve_path;
location ~ /data/v3/(?<postile_path>[0-9]+/[0-9]+/[0-9]+\.pbf)$ {
proxy_pass http://postile/$postile_path;
proxy_cache cache;
proxy_cache_valid 200 204 30d;
proxy_set_header Host $http_host;
proxy_cache_key v3/$postserve_path;
proxy_cache_key v3/$postile_path;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_buffering on;
proxy_cache_lock on;
Expand Down

0 comments on commit 620c9af

Please sign in to comment.