mirror of
https://github.com/luzifer-docker/chrome-firemap.git
synced 2024-12-20 14:31:17 +00:00
Initial port of phantom-firemap
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
commit
602b5c2dbb
3 changed files with 42 additions and 0 deletions
16
Dockerfile
Normal file
16
Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
FROM debian
|
||||
|
||||
ADD https://dl-ssl.google.com/linux/linux_signing_key.pub /tmp/linux_signing_key.pub
|
||||
ADD google.list /etc/apt/sources.list.d/google.list'
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-key add /tmp/linux_signing_key.pub \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y imagemagick google-chrome-stable
|
||||
|
||||
VOLUME ["/data"]
|
||||
ENTRYPOINT ["/usr/local/bin/run.sh"]
|
||||
|
||||
ADD run.sh /usr/local/bin/run.sh
|
||||
|
||||
WORKDIR /data
|
1
google.list
Normal file
1
google.list
Normal file
|
@ -0,0 +1 @@
|
|||
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
|
25
run.sh
Executable file
25
run.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
DPI=150
|
||||
W=1754 # 150 x 11.69
|
||||
H=1241 # 150 x 8.27
|
||||
|
||||
ZOOM=$1
|
||||
LAT=$2
|
||||
LON=$3
|
||||
TARGET="$4"
|
||||
|
||||
google-chrome-stable --version
|
||||
google-chrome-stable --headless --no-sandbox \
|
||||
--hide-scrollbars --disable-gpu --screenshot \
|
||||
--window-size=$W,$H --virtual-time-budget=5000 \
|
||||
"http://openfiremap.org/?zoom=${ZOOM}&lat=${LAT}&lon=${LON}&layers=B0000TF"
|
||||
|
||||
ls -lh
|
||||
mv screenshot.png /data/${TARGET}.png
|
||||
chmod 0644 /data/${TARGET}.png
|
||||
|
||||
exec convert /data/${TARGET}.png -compress jpeg -quality 90 \
|
||||
-resize ${W}x${H} -gravity center -extent ${W}x${H} \
|
||||
-units PixelsPerInch -density ${DPI} \
|
||||
-repage ${W}x${H} /data/${TARGET}.pdf
|
Loading…
Reference in a new issue