Skip to content

Commit 0bc4bdd

Browse files
author
Rub21
committed
Update populate-apidb envs, contianer and readme
1 parent 90a2f13 commit 0bc4bdd

File tree

5 files changed

+54
-46
lines changed

5 files changed

+54
-46
lines changed

docker-compose.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,25 +123,26 @@ services:
123123
depends_on:
124124
- db
125125
# ######################################################
126-
# ### OSM data restoring into the database
126+
# ### Populate apidb from PBF file
127127
# ######################################################
128-
# populate-apidb:
129-
# image: osmseed-populate-apidb:v1
130-
# build:
131-
# context: ./images/populate-apidb
132-
# dockerfile: Dockerfile
133-
# volumes:
134-
# - ./data/populate-apidb-data:/app/data
135-
# depends_on:
136-
# - db
137-
# command: >
138-
# /bin/bash -c "
139-
# echo Sleep for a while populate-apidb!;
140-
# sleep 70s;
141-
# echo Starting populate-apidb!;
142-
# ./start.sh"
143-
# env_file:
144-
# - ./.env
128+
populate-apidb:
129+
image: osmseed-populate-apidb:v1
130+
build:
131+
context: ./images/populate-apidb
132+
dockerfile: Dockerfile
133+
volumes:
134+
- ./data/populate-apidb-data:/mnt/data
135+
depends_on:
136+
- db
137+
command: >
138+
/bin/bash -c "
139+
echo Sleep for a while populate-apidb!;
140+
sleep 4m;
141+
echo Starting populate-apidb!;
142+
/start.sh"
143+
env_file:
144+
- ./envs/.env.db
145+
- ./envs/.env.populate-apidb
145146
# ######################################################
146147
# ### Tiler server(tegola), Database and imposm section
147148
# ######################################################

envs/.env.populate-apidb.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#######################################
2+
# Environment variables for Replication job settings
3+
#######################################
4+
5+
# Link to a public pbf file
6+
URL_FILE_TO_IMPORT=https://download.geofabrik.de/europe/monaco-latest.osm.pbf
7+
8+
#Osmosis tuning for server, This variable intends to use much as possible the memory in the server
9+
MEMORY_JAVACMD_OPTIONS=2Gi
10+

images/populate-apidb/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM developmentseed/osmseed-osm-processor:0.1.0-n497.h0368039
2-
WORKDIR /mnt/data
3-
COPY ./start.sh .
4-
CMD ./start.sh
2+
3+
VOLUME /mnt/data
4+
COPY ./start.sh /
5+
CMD /start.sh

images/populate-apidb/README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
11
# Container to populate APIDB
22

3-
43
This container is in charge to import data from PBF file or OSM files into the API database.
54

6-
75
### Configuration
86

97
This container needs some environment variables passed into it in order to run:
108

9+
### Configuration
1110

12-
- `URL_FILE_TO_IMPORT` it could be a PBF file or OSM file.
13-
14-
Get the files form :
11+
In order to run this container we need environment variables, these can be found in the following files👇:
1512

16-
- http://download.geofabrik.de/
17-
- https://wiki.openstreetmap.org/wiki/Planet.osm
13+
- [.env.db.example](./../../envs/.env.db.example)
14+
- [.env.env.populate-apidb.example](./../../envs/.env.env.populate-apidb.example)
1815

19-
**APIDB configuration**
16+
**Note**: Rename the above files as `.env.db` and `.env.populate-apidb`
2017

21-
- `POSTGRES_HOST`e.g localhost
22-
- `POSTGRES_DB` e.g openstreetmap
23-
- `POSTGRES_USER` e.g postgres
24-
- `POSTGRES_PASSWORD` e.g 1234
18+
- `URL_FILE_TO_IMPORT` it could be a PBF file or OSM file.
2519

26-
#### Building the container
20+
Get those files form 👇
2721

22+
- http://download.geofabrik.de/
23+
- https://wiki.openstreetmap.org/wiki/Planet.osm
2824

29-
```
30-
cd populate-apidb/
31-
docker network create osm-seed_default
32-
docker build -t osmseed-populate-apidb:v1 .
33-
```
25+
#### Running planet-dump container
3426

35-
#### Running the container
27+
```sh
28+
# Docker compose
29+
docker-compose run populate-apidb
3630

31+
# Docker
32+
docker run \
33+
--env-file ./envs/.env.db \
34+
--env-file ./envs/.env.populate-apidb \
35+
-v ${PWD}/data/populate-apidb-data:/mnt/data \
36+
--network osm-seed_default \
37+
-it osmseed-populate-apidb:v1
3738
```
38-
docker run \
39-
--env-file ./../.env \
40-
--network osm-seed_default \
41-
-t osmseed-populate-apidb:v1
42-
```

osm-seed/templates/populate-apidb-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
containers:
1515
- name: {{ .Release.Name }}-populate-apidb-job
1616
image: {{ .Values.populateApidb.image.name }}:{{ .Values.populateApidb.image.tag }}
17-
command: ['./start.sh']
17+
command: ['/start.sh']
1818
{{- if .Values.populateApidb.resources.enabled }}
1919
resources:
2020
requests:

0 commit comments

Comments
 (0)