Skip to content

Commit dbc43b4

Browse files
author
Rub21
committed
Update docs and env vars fro tiler
1 parent 6881e3e commit dbc43b4

File tree

7 files changed

+84
-114
lines changed

7 files changed

+84
-114
lines changed

envs/.env.populate-apidb.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#######################################
44

55
# Link to a public pbf file
6+
# URL_FILE_TO_IMPORT=https://ds-data-projects.s3.amazonaws.com/dc-output.pbf
7+
# URL_FILE_TO_IMPORT=https://ds-data-projects.s3.amazonaws.com/osm-seed-data/ayac.pbf
68
URL_FILE_TO_IMPORT=https://download.geofabrik.de/europe/monaco-latest.osm.pbf
79

810
#Osmosis tuning for server, This variable intends to use much as possible the memory in the server

envs/.env.tiler-db.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#######################################
2+
# Environment variables for tiler database
3+
#######################################
4+
POSTGRES_HOST=tiler-db
5+
POSTGRES_DB=tiler-osm
6+
POSTGRES_USER=postgres
7+
POSTGRES_PASSWORD=1234
8+
POSTGRES_PORT=5432
9+
POSTGRES_DB_MAX_CONNECTIONS=200

envs/.env.tiler-imposm.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# #######################################
2+
# tiler-imposm evn variables
3+
# #######################################
4+
# TILER_IMPORT_FROM=(osm, osmseed)
5+
# Note: In case you use the `TILER_IMPORT_PROM`=`osmseed` you need to make public the minute replication files to update the DB with the recent changes.
6+
TILER_IMPORT_FROM=osm
7+
TILER_IMPORT_PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf
8+
SEQUENCE_NUMBER=4768
9+
REPLICATION_URL=https://download.openstreetmap.fr/replication/europe/monaco/minute/

envs/.env.tiler-server.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# #######################################
2+
# tiler-serve env variables,
3+
# TILER_CACHE_* , by default osmseed-tiler is using aws-s3 for caching the tiles, if you want to change it,
4+
# take a look in: https://github.com/go-spatial/tegola/tree/master/cache
5+
# #######################################
6+
TILER_SERVER_PORT=9090
7+
TILER_CACHE_TYPE=s3
8+
TILER_CACHE_BASEPATH=/mnt/data
9+
TILER_CACHE_MAX_ZOOM=22
10+
## Enable this section In case we use AWS-s3
11+
# TILER_CACHE_* , by default osmseed-tiler is using aws-s3 for caching the tiles, if you want to change it, take a look in: https://github.com/go-spatial/tegola/tree/master/cache
12+
TILER_CACHE_TYPE=s3
13+
TILER_CACHE_TYPE=*
14+
TILER_CACHE_BUCKET=osmseed-staging
15+
TILER_CACHE_BASEPATH=tegola
16+
TILER_CACHE_REGION=us-east-1
17+
TILER_CACHE_AWS_ACCESS_KEY_ID=...
18+
TILER_CACHE_AWS_SECRET_ACCESS_KEY=...

images/tiler-db/README.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,30 @@ PostGIS database container to store the osm-seed or osm data for tiling.
44

55
### Configuration
66

7-
Required environment variables:
7+
In order to run this container we need environment variables, these can be found in the following files👇:
88

9-
- `POSTGRES_HOST` e.g `tiler-db`
10-
- `POSTGRES_DB` e.g `tiler-osm`
11-
- `POSTGRES_PORT` e.g `5432`
12-
- `POSTGRES_USER` e.g `postgres`
13-
- `POSTGRES_PASSWORD` e.g `1234`
9+
- [.env.tiler-db.example](./../../envs/.env.tiler-db.example)
1410

11+
**Note**: Rename the above files as `.env.tiler-db`
1512

16-
#### Building the container
1713

18-
```
19-
cd tiler-db/
20-
docker network create osm-seed_default
21-
docker build -t osmseed-tiler-db:v1 .
22-
```
14+
#### Running tiler-DB container
2315

24-
#### Running the container
16+
```sh
17+
# Docker compose
18+
docker-compose tiler-db
2519

26-
```
20+
#Dcoker
2721
docker run \
28-
--env-file ./../.env-tiler \
29-
--network osm-seed_default \
30-
-v $(pwd)/../postgres-gis-data:/var/lib/postgresql/data \
31-
-p "5433:5432" \
32-
-t osmseed-tiler-db:v1
22+
--env-file ./envs/.env.db-tiler \
23+
--network osm-seed_default \
24+
-v ${PWD}/data/tiler-db-data:/mnt/data \
25+
-p "5433:5432" \
26+
-t osmseed-tiler-db:v1
3327
```
3428

35-
### Test DB connection
29+
### Test tiler-DB connection
3630

37-
```
38-
psql -h 0.0.0.0 -p 5433 -d tiler-db -U postgres --password
31+
```sh
32+
pg_isready -h 0.0.0.0 -p 5433
3933
```

images/tiler-imposm/README.md

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,27 @@ This container is responsible to import the replication PBF files from osm-seed
55
If we are running the container for the first time the container will import the [OSM Land](http://data.openstreetmapdata.com/land-polygons-split-3857.zip) and [Natural Earth dataset](http://nacis.org/initiatives/natural-earth) and [osm-land] files into the data bases. [Check more here](https://github.com/go-spatial/tegola-osm#import-the-osm-land-and-natural-earth-dataset-requires-gdal-natural-earth-can-be-skipped-if-youre-only-interested-in-osm).
66

77

8-
98
### Configuration
109

11-
Required environment variables:
12-
13-
**Env variables to connect to the db-tiler**
14-
15-
- `POSTGRES_HOST` e.g `tiler-db`
16-
- `POSTGRES_DB` e.g `tiler-osm`
17-
- `POSTGRES_PORT` e.g `5432`
18-
- `POSTGRES_USER` e.g `postgres`
19-
- `POSTGRES_PASSWORD` e.g `1234`
20-
21-
**Env variables to import the files**
22-
23-
- `TILER_IMPORT_FROM` e.g `osm` or `osmseed`
24-
- `TILER_IMPORT_PBF_URL` eg `http://download.geofabrik.de/south-america/peru-latest.osm.pbf`
25-
26-
27-
28-
If you are setting up the variable TILER_IMPORT_PROM=`osmseed` you should fill following env variables according to which cloud provider you are going to use
29-
30-
- `CLOUDPROVIDER`, eg. `aws` or `gcp`
31-
32-
In case AWS:
33-
34-
- `AWS_S3_BUCKET` e.g `s3://osm-seed-test`
10+
In order to run this container we need environment variables, these can be found in the following files👇:
3511

36-
In case GCP:
12+
- [.env.tiler-db.example](./../../envs/.env.tiler-db.example)
13+
- [.env.tiler-imposm.example](./../../envs/.env.tiler-imposm.example)
3714

38-
- `GCP_STORAGE_BUCKET` e.g `gs://osm-seed-test`
15+
**Note**: Rename the above files as `.env.tiler-db` and `.env.tiler-imposm`
3916

40-
Note: In case you use the `TILER_IMPORT_PROM`=`osmseed` you need to make public the minute replication files to update the DB with the recent changes.
17+
#### Running tiler-imposm container
4118

19+
```sh
20+
# Docker compose
21+
docker-compose run tiler-imposm
4222

43-
#### Building the container
44-
45-
```
46-
cd tiler-imposm/
47-
docker network create osm-seed_default
48-
docker build -t osmseed-tiler-imposm:v1 .
49-
```
50-
51-
#### Running the container
52-
53-
```
23+
# Docker
5424
docker run \
55-
--env-file ./../.env-tiler \
56-
--network osm-seed_default \
57-
-v ${PWD}:/mnt/data \
58-
-t osmseed-tiler-imposm:v1
25+
--env-file ./envs/.env.tiler-db \
26+
--env-file ./envs/.env.tiler-imposm \
27+
-v ${PWD}/data/tiler-imposm-data:/mnt/data \
28+
--network osm-seed_default \
29+
-it osmseed-tiler-imposm:v1
5930
```
6031

61-
#### Access the container
62-
63-
```
64-
docker run \
65-
--env-file ./../.env-tiler \
66-
--network osm-seed_default \
67-
-v ${PWD}:/mnt/data \
68-
-it osmseed-tiler-imposm:v1 bash
69-
```

images/tiler-server/README.md

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,27 @@
22

33
This container is for rendering the vector tiles base on [Tegola](https://github.com/go-spatial/tegola), the container connects to the database `tiler-db` and serves the tiles through the port `9090`.
44

5-
65
### Configuration
76

8-
Required environment variables:
9-
10-
**Env variables to connect to the db-tiler**
11-
12-
- `POSTGRES_HOST` e.g `tiler-db`
13-
- `POSTGRES_DB` e.g `tiler-osm`
14-
- `POSTGRES_PORT` e.g `5432`
15-
- `POSTGRES_USER` e.g `postgres`
16-
- `POSTGRES_PASSWORD` e.g `1234`
17-
18-
**Env variables to serve the tiles**
19-
20-
- `TILER_SERVER_PORT` e.g `9090`
7+
In order to run this container we need environment variables, these can be found in the following files👇:
218

22-
**Env variables for caching the tiles**
9+
- [.env.tiler-db.example](./../../envs/.env.tiler-db.example)
10+
- [.env.tiler-server.example](./../../envs/.env.tiler-server.example)
2311

24-
TILER_CACHE_* , by default osmseed-tiler is using aws-s3 for caching the tiles, if you want to change it, take a look in: https://github.com/go-spatial/tegola/tree/master/cache
12+
**Note**: Rename the above files as `.env.tiler-db` and `.env.tiler-server`
2513

26-
- `TILER_SERVER_PORT` e.g `9090`
27-
- `TILER_CACHE_TYPE` e.g `s3`
28-
- `TILER_CACHE_BUCKET` e.g `s3://osmseed-tiler`
29-
- `TILER_CACHE_BASEPATH` e.g `local`
30-
- `TILER_CACHE_REGION` e.g `us-east-1`
31-
- `TILER_CACHE_AWS_ACCESS_KEY_ID` e.g `xyz`
32-
- `TILER_CACHE_AWS_SECRET_ACCESS_KEY` e.g `xyz`
33-
- `TILER_CACHE_MAX_ZOOM` e.g `22`
34-
35-
#### Building the container
36-
37-
```
38-
cd tiler-server/
39-
docker network create osm-seed_default
40-
docker build -t osmseed-tiler-server:v1 .
41-
```
14+
#### Running tiler-server container
4215

43-
#### Running the container
16+
```sh
17+
# Docker compose
18+
docker-compose run tiler-server
4419

20+
# Docker
21+
docker run \
22+
--env-file ./envs/.env.tiler-db \
23+
--env-file ./envs/.env.tiler-server \
24+
-v ${PWD}/data/tiler-server-data:/mnt/data \
25+
--network osm-seed_default \
26+
-p "9090:9090" \
27+
-it osmseed-tiler-server:v1
4528
```
46-
docker run \
47-
--env-file ./../.env-tiler \
48-
--network osm-seed_default \
49-
-v $(pwd)/:/mnt/data \
50-
-p "9090:9090" \
51-
-t osmseed-tiler-server:v1
52-
```

0 commit comments

Comments
 (0)