FROM debian:bookworm-slim AS builder RUN apt-get update && \ apt-get -y --no-install-recommends install \ curl ca-certificates gdal-bin python3 libssl-dev && \ rm -rf /var/lib/apt/lists/* WORKDIR /build/ # RUN curl -Of https://geonames.usgs.gov/docs/stategaz/NationalFile.zip COPY NationalFile.zip . COPY update.py config.toml.template /build/ RUN python3 update.py > NationalFile.geojsons RUN ogr2ogr -t_srs epsg:3857 -s_srs epsg:4269 NationalFile.fgb NationalFile.geojsons FROM rust:slim-bullseye AS trex RUN apt-get update && \ apt-get -y --no-install-recommends install \ pkg-config libssl-dev build-essential curl ca-certificates \ gdal-bin libgdal-dev python3 && \ rm -rf /var/lib/apt/lists/* RUN cargo install --git https://github.com/t-rex-tileserver/t-rex --tag v0.14.3 FROM debian:bookworm-slim RUN apt-get update && \ apt-get -y --no-install-recommends install \ curl ca-certificates gdal-bin python3 libssl-dev && \ rm -rf /var/lib/apt/lists/* COPY --from=trex /usr/local/cargo/bin/t_rex /usr/local/bin/ WORKDIR /var/data/in VOLUME ["/var/data/in"] VOLUME ["/var/data/out"] USER www-data EXPOSE 6767 ENTRYPOINT ["/usr/local/bin/t_rex"] COPY --from=builder /build/NationalFile.fgb /build/config.toml ./ ENV PORT 8080 CMD ["serve","--config","config.toml","--bind","0","--port","\$PORT"]