-
Notifications
You must be signed in to change notification settings - Fork 17
deploy
After tiles are generated, they are ready to be deployed to server(s).
There are many ways to handle this, such as using rsync
, tar
, etc.
Here's an example using tar
:
cd
to the host directory that corresponds to the container's /var/lib/mod_tile
. In the previous docker-compose.yml
, this is mounted from the host's ./docker/osm/mod_tile
.
$ cd ./docker/osm/mod_tile
tar
the default
directory to mod_tile.tar
. Since the tiles are images that undergo negligible compression, we will not use any compression.
$ tar cvf mod_tile.tar default
Generating a checksum file is recommended to verify integrity of the tar file upon transfer:
$ shasum mod_tile.tar > mod_tile.tar.sha1
Copy the tar file and checksum file to your server using your preferred transfer method, e.g. rsync
or scp
$ rsync -av mod_tile.tar* yourserver:
# OR
$ scp mod_tile.tar* yourserver:
On the server, verify the file integrity of the tranferred file:
$ shasum -c mod_tile.tar.sha1
Back up existing mod_tile
directory if needed, and deploy the tiles from the tar
file. Using a symbolic link to directory other than mod_tile
can be handy for keeping track of tiles' heritage.
$ cd /var/lib
$ sudo mv mod_tile mod_tile.orig
$ sudo mkdir mod_tile.pregenerated
$ sudo ln -s mod_tile.pregenerated mod_tile
$ cd mod_tile.pregenerated
$ sudo tar xvf ~/mod_tile.tar
This should deploy ~/mod_tile.tar
into /var/lib/mod_tile.pregenerated/default
. Since /var/lib/mod_tile
was symbolically linked to /var/lib/mod_tile.pregenerated
, Apache's mod_tile
module should now be serving tiles from its default location.