Skip to content

Commit 0baeb26

Browse files
authored
Merge pull request #2 from smithmicro/ubuntu
ubuntu:focal
2 parents cc96dc6 + 786de0b commit 0baeb26

File tree

5 files changed

+42
-73
lines changed

5 files changed

+42
-73
lines changed

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ n7m is Nominatim packaged in Docker images with separation of responsibilities b
99
## Overview
1010
This set of Docker images seperates responsbility into 5 areas:
1111
* **n7m-app** - The main Nomainatim service running Apache/PHP connecting to `n7m-gis`
12-
* **feed** - Uses the `n7m-app` image to set up the `n7m-gis` database. Can also be used for updates and downloading OSM files.
12+
* **feed** - Uses the `n7m-app` image to set up the `n7m-gis` database. Can also be used for updates and downloading files.
1313
* **n7m-test** - Runs all unit tests
1414
* **n7m-gis** - Postgis database
1515
* **n7m-ui** - Test web user interface
@@ -50,14 +50,15 @@ This set of Docker images seperates responsbility into 5 areas:
5050
## To Use
5151
1. Build all the images:
5252
* `docker-compose build`
53-
2. Download the desired OSM files:
54-
* To download Monaco, Wikimedia data and country grids:
55-
* `docker-compose run feed download --monaco --wiki --grid`
56-
3. Edit the OSM_FILENAME environment varianble in `docker-compose.yml` file to select the downloaded OSM file.
57-
* The default is monaco-latest.osm.pbf
58-
4. Run `docker-compose up`
53+
2. Download Wikimedia data and country grids (optional):
54+
* `docker-compose run feed download --wiki --grid`
55+
3. Download OSM Data. We recommend [openmaptiles-tools](https://github.com/openmaptiles/openmaptiles-tools). For Monaco:
56+
* `docker run -v $PWD/data:/tileset openmaptiles/openmaptiles-tools download-osm monaco`
57+
4. Edit the OSM_FILENAME environment varianble in `docker-compose.yml` file to select the downloaded OSM file.
58+
* The default is `monaco-latest.osm.pbf` which was downloaded in step 3.
59+
5. Run `docker-compose up`
5960
* Since the import process is long, the `n7m-app` container terminates after 10 seconds. Run `docker-compose up` again after import so it restarts.
60-
5. Browse to: `http://localhost:8080`
61+
6. Browse to: `http://localhost:8080`
6162

6263
## Additional Commands
6364
1. To reset the database:
@@ -75,13 +76,19 @@ For updates, consider these configurations:
7576
* NOMINATIM_REPLICATION_URL - you will want to set this to a closer mirror.
7677

7778
## Ubuntu vs Debian
78-
`debian:bullseye-slim` was selected as the base image as it is slightly smealler than `ubuntu:focal` and supports PoostgreSQL 13. Versions that are included below (at the time of this writing):
79+
`ubuntu:jammy` was selected as the base image for branch image as to begin testing the lastest LTS release. Versions that are included below (at the time of this writing):
7980
* `debian:bullseye-slim`
8081
* 454MB Image for `n7m-app`
8182
* Python 3.9.2, PHP 7.4.28, psql 13.7
8283
* `ubuntu:focal`
8384
* 485MB Image for `n7m-app`
8485
* Python 3.8.10, PHP 7.4.3, psql 12.11
86+
* `debian:bookworm-slim` (not released)
87+
* 501MB Image for `n7m-app`
88+
* Python 3.10.5, PHP 8.1.5, psql 14.4
89+
* `ubuntu:jammy`
90+
* 528MB Image for `n7m-app`
91+
* Python 3.10.4, PHP 8.1.2, psql 14.3
8592

8693
## Advanced Tokenizer
8794
This image only uses the ICU Tokenizer. By default the included `tokenizer.php` file drives the PHP code and has a simple English tokenizer.
@@ -102,3 +109,8 @@ To run n7m in AWS, the minimum EC2 Instance sizing is:
102109
* Storage: 500GB SSD (270G required for North America)
103110

104111
Note: At 16 GB RAM, `t3.xlarge` is too small and runs out of memory for osm2pgsql during a North America test.
112+
113+
## Downloading data
114+
https://wiki.openstreetmap.org/wiki/Downloading_data
115+
116+
docker run -v $PWD:/data openmaptiles/openmaptiles-tools download-osm

app/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim AS build
1+
FROM ubuntu:jammy AS build
22

33
# https://nominatim.org/release-docs/develop/appendix/Install-on-Ubuntu-20/
44
# Changes from the docs:
@@ -23,10 +23,10 @@ RUN apt-get update && apt-get install -y \
2323
php-cgi \
2424
php-pgsql \
2525
php-intl \
26-
postgresql-13-postgis-3 \
27-
postgresql-13-postgis-3-scripts \
28-
postgresql-contrib-13 \
29-
postgresql-server-dev-13 \
26+
postgresql-14-postgis-3 \
27+
postgresql-14-postgis-3-scripts \
28+
postgresql-contrib-14 \
29+
postgresql-server-dev-14 \
3030
python3-datrie \
3131
python3-dotenv \
3232
python3-icu \
@@ -50,7 +50,7 @@ RUN curl -O -L http://www.nominatim.org/release/Nominatim-$NOMINATIM_VERSION.tar
5050
&& make install
5151

5252
# now start over from the same base image
53-
FROM debian:bullseye-slim
53+
FROM ubuntu:jammy
5454

5555
ENV DEBIAN_FRONTEND=noninteractive
5656

@@ -65,7 +65,7 @@ RUN apt-get update && apt-get install -y \
6565
php-fpm \
6666
php-pgsql \
6767
php-intl \
68-
postgresql-client-13 \
68+
postgresql-client-14 \
6969
python3-datrie \
7070
python3-dotenv \
7171
python3-icu \

app/download.sh

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
22

3-
set -e
3+
# download data from www.nominatim.org
4+
# For OSM files, please use:
5+
# https://github.com/openmaptiles/openmaptiles-tools
46

5-
MIRROR_URI=https://download.geofabrik.de
7+
set -e
68

79
download() {
810
DOWNLOAD_FILENAME=$(basename "$1")
@@ -21,15 +23,6 @@ download() {
2123

2224
help() {
2325
echo "download [-n|-m|-w|-u|-k|-g|-h] [long options see below]"
24-
echo " -f|--africa - Africa OSM file"
25-
echo " -t|--antarctica - Antarctica OSM file"
26-
echo " -a|--asia - Asia OSM file"
27-
echo " -o|--oceania - Australia and Oceania OSM file"
28-
echo " -c|--central-america - Central America OSM file"
29-
echo " -e|--europe - Europe OSM file"
30-
echo " -n|--north-america - North America OSM file"
31-
echo " -s|--south-america - South America OSM file"
32-
echo " -m|--monaco - Monaco OSM File - a small test"
3326
echo " -w|--wiki - Wikimedia file to improve search"
3427
echo " -u|--us-postal - US postal code data"
3528
echo " -k|--uk-postal - UK postal code data"
@@ -42,54 +35,18 @@ help() {
4235

4336
while [[ $# -gt 0 ]]; do
4437
case $1 in
45-
-f|--africa)
46-
download $MIRROR_URI/africa-latest.osm.pbf
47-
shift
48-
;;
49-
-t|--antarctica)
50-
download $MIRROR_URI/antarctica-latest.osm.pbf
51-
shift
52-
;;
53-
-a|--asia)
54-
download $MIRROR_URI/asia-latest.osm.pbf
55-
shift
56-
;;
57-
-o|--oceania)
58-
download $MIRROR_URI/australia-oceania-latest.osm.pbf
59-
shift
60-
;;
61-
-c|--central-america)
62-
download $MIRROR_URI/central-america-latest.osm.pbf
63-
shift
64-
;;
65-
-e|--europe)
66-
download $MIRROR_URI/europe-latest.osm.pbf
67-
shift
68-
;;
69-
-n|--north-america)
70-
download $MIRROR_URI/north-america-latest.osm.pbf
71-
shift
72-
;;
73-
-s|--south-america)
74-
download $MIRROR_URI/south-america-latest.osm.pbf
75-
shift
76-
;;
77-
-m|--monaco)
78-
download $MIRROR_URI/europe/monaco-latest.osm.pbf
79-
shift
80-
;;
8138
-w|--wiki)
8239
# improve the quality of search results
8340
download https://www.nominatim.org/data/wikimedia-importance.sql.gz
8441
shift
8542
;;
8643
-u|--us-postal)
87-
# improve postal code search
44+
# improve US postal code search
8845
download https://www.nominatim.org/data/us_postcodes.csv.gz
8946
shift
9047
;;
9148
-k|--uk-postal)
92-
# improve postal code search
49+
# improve UK postal code search
9350
download https://www.nominatim.org/data/gb_postcodes.csv.gz
9451
shift
9552
;;

gis/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM postgis/postgis:13-3.2-alpine
1+
FROM postgis/postgis:14-3.2-alpine
22

33
# Nominatim recommended configuration
44
COPY --chown=postgres:postgres postgresql.conf /etc/postgresql/postgresql.conf

test/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim AS build
1+
FROM ubuntu:jammy AS build
22

33
# https://nominatim.org/release-docs/develop/appendix/Install-on-Ubuntu-20/
44
# Changes from the docs:
@@ -23,10 +23,10 @@ RUN apt-get update && apt-get install -y \
2323
php-cgi \
2424
php-pgsql \
2525
php-intl \
26-
postgresql-13-postgis-3 \
27-
postgresql-13-postgis-3-scripts \
28-
postgresql-contrib-13 \
29-
postgresql-server-dev-13 \
26+
postgresql-14-postgis-3 \
27+
postgresql-14-postgis-3-scripts \
28+
postgresql-contrib-14 \
29+
postgresql-server-dev-14 \
3030
python3-datrie \
3131
python3-dotenv \
3232
python3-icu \
@@ -50,7 +50,7 @@ RUN curl -O -L http://www.nominatim.org/release/Nominatim-$NOMINATIM_VERSION.tar
5050
&& make install
5151

5252
# now start over from the same base image
53-
FROM debian:bullseye-slim
53+
FROM ubuntu:jammy
5454

5555
# https://nominatim.org/release-docs/4.0.1/develop/Testing/
5656
ENV DEBIAN_FRONTEND=noninteractive
@@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \
6262
php-codecoverage \
6363
php-pgsql \
6464
php-xdebug \
65-
postgresql-client-13 \
65+
postgresql-client-14 \
6666
python3-behave \
6767
python3-datrie \
6868
python3-dotenv \

0 commit comments

Comments
 (0)