member-map/Dockerfile

27 lines
870 B
Docker
Raw Normal View History

2022-10-09 14:03:18 +02:00
FROM ubuntu:22.04
ARG PLZ_DATA=Postleitzahlengebiete_-_OSM.geojson
2024-06-28 16:13:10 +02:00
ARG PLZ_HIGHLIGHT=contacts-zip-anonym.json
ARG IMG_BG_COLOR=#FFFFFF
ARG MAP_BG_COLOR=#4279BC
ARG MAP_ACCENT_COLOR=#DA532C
2022-10-09 14:03:18 +02:00
# Set up environment with dependencies
2022-10-28 17:43:43 +02:00
RUN apt-get update && apt-get install libblas-dev python3-pip libgeos-dev wget optipng imagemagick -y
2022-10-09 14:03:18 +02:00
COPY requirements.txt ./
RUN pip install -r requirements.txt
# Copy all relevant data
COPY $PLZ_DATA ./
COPY $PLZ_HIGHLIGHT ./
# Render map
COPY main.py ./
2024-06-28 16:13:10 +02:00
RUN python3 main.py --plz-data $PLZ_DATA --plz-highlight $PLZ_HIGHLIGHT --img-bg-color $IMG_BG_COLOR --map-bg-color $MAP_BG_COLOR --map-accent-color $MAP_ACCENT_COLOR --out /tmp/map.png
2022-10-09 14:03:18 +02:00
2022-10-28 17:43:43 +02:00
RUN convert -fuzz 5 -trim /tmp/map.png /tmp/map.png
RUN optipng -o7 /tmp/map.png
2022-10-09 14:03:18 +02:00
# Output map; use with "docker build -t wtf-map . && docker run wtf-map > map.png"
CMD ["cat", "/tmp/map.png"]