Skip to content

Commit ccf3e20

Browse files
committed
Improve docs
1 parent 585e960 commit ccf3e20

File tree

1 file changed

+38
-25
lines changed

1 file changed

+38
-25
lines changed

DOCKER-RUN.md

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ Create directory for the `.osm.pbf` file and output `.sql` file.
1212
mkdir ~/pgosm-data
1313
```
1414

15+
16+
Set environment variables for the temporary Postgres connection in Docker.
17+
18+
```bash
19+
export POSTGRES_USER=postgres
20+
export POSTGRES_PASSWORD=mysecretpassword
21+
```
22+
23+
1524
Start the `pgosm` Docker container to make PostgreSQL/PostGIS available.
1625
This command exposes Postgres inside Docker on port 5433 and establishes links
1726
to the local directory created above (`~/pgosm-data`).
@@ -23,7 +32,7 @@ your the host machine's timezone, important when for archiving PBF & MD5 files b
2332
docker run --name pgosm -d --rm \
2433
-v ~/pgosm-data:/app/output \
2534
-v /etc/localtime:/etc/localtime:ro \
26-
-e POSTGRES_PASSWORD=mysecretpassword \
35+
-e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
2736
-p 5433:5432 -d rustprooflabs/pgosm-flex
2837
```
2938

@@ -40,7 +49,7 @@ The 3rd parameter tells the script the server has 8 GB RAM available for osm2pgs
4049

4150
```bash
4251
docker exec -it \
43-
-e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=postgres \
52+
-e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_USER=$POSTGRES_USER \
4453
pgosm python3 docker/pgosm_flex.py \
4554
--layerset=run-all --ram=8 \
4655
--region=north-america/us \
@@ -62,31 +71,35 @@ Usage: pgosm_flex.py [OPTIONS]
6271
Logic to run PgOSM Flex within Docker.
6372

6473
Options:
65-
--layerset TEXT Layer set from PgOSM Flex to load. e.g. run-all
66-
[default: (run-all);required]
67-
--ram INTEGER Amount of RAM in GB available on the server running this
68-
process. [default: 8;required]
69-
--region TEXT Region name matching the filename for data sourced from
70-
Geofabrik. e.g. north-america/us [default: (north-
71-
america/us);required]
72-
--subregion TEXT Sub-region name matching the filename for data sourced
73-
from Geofabrik. e.g. district-of-columbia [default:
74-
(district-of-columbia)]
75-
--srid INTEGER SRID for data in PostGIS.
76-
--pgosm-date TEXT Date of the data in YYYY-MM-DD format. Set to historic
77-
date to load locally archived PBF/MD5 file, will fail if
78-
both files do not exist.
79-
--skip-nested When True, skips calculating nested admin polygons. Can
80-
be time consuming on large regions.
81-
--data-only When True, skips running Sqitch and importing QGIS
82-
Styles.
83-
--debug Enables additional log output
84-
--basepath TEXT Debugging option. Used when testing locally and not
85-
within Docker
86-
--help Show this message and exit.
74+
--layerset TEXT Layer set from PgOSM Flex to load. e.g. run-all
75+
[default: (run-all);required]
76+
--ram INTEGER Amount of RAM in GB available on the server running this
77+
process. [default: 4;required]
78+
--region TEXT Region name matching the filename for data sourced from
79+
Geofabrik. e.g. north-america/us [default: (north-
80+
america/us);required]
81+
--subregion TEXT Sub-region name matching the filename for data sourced
82+
from Geofabrik. e.g. district-of-columbia [default:
83+
(district-of-columbia)]
84+
--srid TEXT SRID for data in PostGIS.
85+
--pgosm-date TEXT Date of the data in YYYY-MM-DD format. Set to historic
86+
date to load locally archived PBF/MD5 file, will fail if
87+
both files do not exist.
88+
--language TEXT Set default language in loaded OpenStreetMap data when
89+
available. e.g. 'en' or 'kn'.
90+
--schema-name TEXT Coming soon
91+
--skip-nested When True, skips calculating nested admin polygons. Can
92+
be time consuming on large regions.
93+
--data-only When True, skips running Sqitch and importing QGIS
94+
Styles.
95+
--debug Enables additional log output
96+
--basepath TEXT Debugging option. Used when testing locally and not
97+
within Docker
98+
--help Show this message and exit.
8799
```
88100
89-
An example of running with all current options.
101+
An example of running with all current options, except `--basepath` which is only
102+
used during development.
90103
91104
```bash
92105
docker exec -it \

0 commit comments

Comments
 (0)