Allow custom ports for postserve/tileserver (#887)

* `make start-postserve PPORT=8000`
* `make start-tileserver TPORT=9000`

Note that both ports need to be the same on host and inside the docker container because the services include a URL to the tiles as part of their manifest.
pull/886/head^2
Yuri Astrakhan 2020-05-26 15:19:52 -04:00 zatwierdzone przez GitHub
rodzic 495e8bd370
commit dbf130deb0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 16 dodań i 9 usunięć

Wyświetl plik

@ -12,6 +12,13 @@ USE_PRELOADED_IMAGE?=
# If set, this file will be imported in the import-osm target
PBF_FILE?=
# Local port to use with postserve
PPORT?=8090
export PPORT
# Local port to use with tileserver
TPORT?=8080
export TPORT
# Allow a custom docker-compose project name
ifeq ($(strip $(DC_PROJECT)),)
override DC_PROJECT:=$(notdir $(shell pwd))
@ -56,8 +63,8 @@ help:
@echo " "
@echo "Hints for designers:"
@echo " make start-maputnik # start Maputnik Editor + dynamic tile server [ see $(OMT_HOST):8088 ]"
@echo " make start-postserve # start dynamic tile server [ see $(OMT_HOST):8090 ]"
@echo " make start-tileserver # start maptiler/tileserver-gl [ see $(OMT_HOST):8080 ]"
@echo " make start-postserve # start dynamic tile server [ see $(OMT_HOST):$(PPORT)} ]"
@echo " make start-tileserver # start maptiler/tileserver-gl [ see $(OMT_HOST):$(TPORT) ]"
@echo " "
@echo "Hints for developers:"
@echo " make # build source code"
@ -226,22 +233,22 @@ start-tileserver: init-dirs
@echo "***********************************************************"
@echo "* "
@echo "* Start maptiler/tileserver-gl "
@echo "* ----------------------------> check $(OMT_HOST):8080 "
@echo "* ----------------------------> check $(OMT_HOST):$(TPORT) "
@echo "* "
@echo "***********************************************************"
@echo " "
docker run $(DC_OPTS) -it --name tileserver-gl -v $$(pwd)/data:/data -p 8080:8080 maptiler/tileserver-gl --port 8080
docker run $(DC_OPTS) -it --name tileserver-gl -v $$(pwd)/data:/data -p $(TPORT):$(TPORT) maptiler/tileserver-gl --port $(TPORT)
.PHONY: start-postserve
start-postserve: start-db
@echo " "
@echo "***********************************************************"
@echo "* "
@echo "* Bring up postserve at $(OMT_HOST):8090"
@echo "* Bring up postserve at $(OMT_HOST):$(PPORT)"
@echo "* --> can view it locally (use make start-maputnik)"
@echo "* --> or can use https://maputnik.github.io/editor"
@echo "* "
@echo "* set data source / TileJSON URL to $(OMT_HOST):8090"
@echo "* set data source / TileJSON URL to $(OMT_HOST):$(PPORT)"
@echo "* "
@echo "***********************************************************"
@echo " "
@ -258,7 +265,7 @@ start-maputnik: stop-maputnik start-postserve
@echo "* "
@echo "* Start maputnik/editor "
@echo "* ---> go to $(OMT_HOST):8088 "
@echo "* ---> set data source / TileJSON URL to $(OMT_HOST):8090"
@echo "* ---> set data source / TileJSON URL to $(OMT_HOST):$(PPORT)"
@echo "* "
@echo "***********************************************************"
@echo " "

Wyświetl plik

@ -71,11 +71,11 @@ services:
postserve:
image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"
command: postserve openmaptiles.yaml --verbose
command: "postserve openmaptiles.yaml --verbose --port ${PPORT:-8090}"
env_file: .env
networks:
- postgres_conn
ports:
- "8090:8090"
- "${PPORT:-8090}:${PPORT:-8090}"
volumes:
- .:/tileset