Skip to content

Commit 41885e4

Browse files
committed
Updating -full docker services for testing
1 parent 14ebcdc commit 41885e4

File tree

4 files changed

+27
-36
lines changed

4 files changed

+27
-36
lines changed

.github/workflows/docker-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Lint with hadolint
20-
uses: hadolint/hadolint-action@v3.1.0
20+
uses: hadolint/hadolint-action@v3.3.0
2121
with:
2222
dockerfile: Dockerfile*
2323
failure-threshold: warning

docker/archlinux/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RUN --mount=type=cache,sharing=locked,id=archlinux:${archlinux_version}-/var/cac
3535
git \
3636
glib2 \
3737
iniparser \
38+
jemalloc \
3839
lcov \
3940
libmemcached \
4041
make \
@@ -53,7 +54,8 @@ RUN CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" && export CMAKE_BUILD_PARALLEL_LEVEL &
5354
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
5455
-DCMAKE_INSTALL_RUNSTATEDIR:PATH=/run \
5556
-DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc \
56-
-DENABLE_TESTS:BOOL=ON && \
57+
-DENABLE_TESTS:BOOL=ON \
58+
-DMALLOC_LIB:STRING=jemalloc && \
5759
cmake --build .
5860
RUN CTEST_PARALLEL_LEVEL="$(nproc)" && export CTEST_PARALLEL_LEVEL && \
5961
ctest --output-on-failure
@@ -76,6 +78,7 @@ RUN --mount=type=cache,sharing=locked,id=archlinux:${archlinux_version}-/var/cac
7678
curl \
7779
glib2 \
7880
iniparser \
81+
jemalloc \
7982
libmemcached \
8083
mapnik \
8184
memcached \

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ services:
316316
<<: *build_defaults_ubuntu
317317
args:
318318
libiniparser_version: 4
319-
libmapnik_version: "4.1"
319+
libmapnik_version: "4.2"
320320
runner_additional_packages: >-
321321
curl
322322
gdal-bin

docker/full-entrypoint.sh

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,37 @@
11
#!/usr/bin/env sh
22

3-
if [ ! -f /opt/styles/mapnik.xml ]
4-
then
5-
git clone https://github.com/gravitystorm/openstreetmap-carto.git --depth 1 /opt/openstreetmap-carto
3+
export DATADIR=/opt/data
4+
export FONTDIR=/opt/fonts
5+
export MAPNIK_XML=/opt/styles/mapnik.xml
66

7-
cp --archive /opt/openstreetmap-carto/patterns /opt/openstreetmap-carto/symbols /opt/styles/
7+
sed -i \
8+
-e "s#^xml=.*#xml=${MAPNIK_XML}#Ig" \
9+
-e "s#^pid_file=#num_threads=-1\npid_file=#Ig" \
10+
-e "s#^font_dir=.*#font_dir=${FONTDIR}#Ig" \
11+
/etc/renderd.conf
812

9-
python3 /opt/openstreetmap-carto/scripts/get-external-data.py --cache --config /opt/openstreetmap-carto/external-data.yml --data /opt/data
13+
if [ ! -f ${MAPNIK_XML} ]
14+
then
15+
export OPENSTREETMAP_CARTO_DIR=/opt/openstreetmap-carto
16+
git clone https://github.com/openstreetmap-carto/openstreetmap-carto.git --depth 1 ${OPENSTREETMAP_CARTO_DIR}
1017

11-
cd /opt && /opt/openstreetmap-carto/scripts/get-fonts.sh && cd -
18+
cp --archive ${OPENSTREETMAP_CARTO_DIR}/patterns ${OPENSTREETMAP_CARTO_DIR}/symbols /opt/styles/
1219

13-
psql --command "CREATE EXTENSION postgis;" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}"
14-
psql --command "CREATE EXTENSION hstore;" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}"
15-
psql --command "ALTER TABLE geometry_columns OWNER TO ${PGUSER};" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}"
16-
psql --command "ALTER TABLE spatial_ref_sys OWNER TO ${PGUSER};" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}"
20+
export EXTERNAL_DATA_SCRIPT_FLAGS="--cache --config ${OPENSTREETMAP_CARTO_DIR}/external-data.yml --data ${DATADIR} --no-update"
21+
export OSM2PGSQL_DATAFILE="${DATADIR}/region.osm.pbf"
1722

18-
if [ ! -f /opt/data/region.osm.pbf ]
23+
if [ ! -f ${OSM2PGSQL_DATAFILE} ]
1924
then
20-
curl --location "${DOWNLOAD_PBF:-http://download.geofabrik.de/asia/vietnam-latest.osm.pbf}" --output /opt/data/region.osm.pbf
25+
curl --location "${DOWNLOAD_PBF:-http://download.geofabrik.de/asia/vietnam-latest.osm.pbf}" --output ${OSM2PGSQL_DATAFILE}
2126
fi
2227

23-
osm2pgsql \
24-
--create \
25-
--database "${PGDATABASE}" \
26-
--host "${PGHOST}" \
27-
--hstore \
28-
--number-processes "$(nproc)" \
29-
--slim \
30-
--tag-transform-script /opt/openstreetmap-carto/openstreetmap-carto.lua \
31-
--user "${PGUSER}" \
32-
-G \
33-
-S /opt/openstreetmap-carto/openstreetmap-carto.style \
34-
/opt/data/region.osm.pbf
35-
36-
psql --dbname "${PGDATABASE}" --file /opt/openstreetmap-carto/indexes.sql --host "${PGHOST}" --user "${PGUSER}"
28+
cd ${OPENSTREETMAP_CARTO_DIR}
29+
30+
sh scripts/docker-startup.sh import
3731

3832
npm install --global carto
39-
carto /opt/openstreetmap-carto/project.mml > /opt/styles/mapnik.xml
33+
carto ${OPENSTREETMAP_CARTO_DIR}/project.mml > ${MAPNIK_XML}
4034
fi
4135

42-
sed -i \
43-
-e 's#/usr/share/renderd/example-map/mapnik.xml#/opt/styles/mapnik.xml#g' \
44-
-e 's/pid_file=/num_threads=-1\npid_file=/g' \
45-
-e 's#font_dir=.*#font_dir=/opt/fonts#g' \
46-
/etc/renderd.conf
47-
4836
apachectl -e debug -k start
4937
renderd --foreground

0 commit comments

Comments
 (0)