Use custom arm64 PG16+PostGIS+TimescaleDB image (no upstream arm64 postgis-timescale tag exists)
Some checks failed
build-and-deploy / build (push) Failing after 17s

This commit is contained in:
sirius0xdev 2026-07-07 18:00:45 -04:00
parent 3d53ed2c1c
commit 14a9178f8c
No known key found for this signature in database
2 changed files with 38 additions and 1 deletions

32
Dockerfile.pg Normal file
View file

@ -0,0 +1,32 @@
# Custom arm64 PostgreSQL 16 image with PostGIS 3 + TimescaleDB 2.
# Timescale's published timescaledb-postgis image is amd64-only, so we build
# our own on Debian 12 (arm64). The app only uses standard SQL types (UUID,
# JSON, TSVECTOR, float lat/lon), so pg16 is fully sufficient.
FROM debian:12
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gnupg lsb-release && \
install -d /usr/share/postgresql-common/pgdg && \
curl -fsSL -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc \
https://www.postgresql.org/media/keys/ACCC4CF8.asc && \
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] \
https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" \
> /etc/apt/sources.list.d/pgdg.list && \
curl -fsSL https://packagecloud.io/install/repositories/timescale/timescaledb/script.deb.sh | bash && \
apt-get update && apt-get install -y --no-install-recommends \
postgresql-16 postgresql-16-postgis-3 timescaledb-2-postgresql-16 && \
# load TimescaleDB at startup
sed -ri "s/^#?shared_preload_libraries = .*/shared_preload_libraries = 'timescaledb'/" \
/etc/postgresql/16/main/postgresql.conf && \
rm -rf /var/lib/apt/lists/*
# Match the official postgres image layout so volume mounts/behavior are familiar.
VOLUME ["/var/lib/postgresql/data"]
EXPOSE 5432
# Run as the postgres user (uid 999) like the official image.
USER postgres
ENV PGDATA=/var/lib/postgresql/data
ENTRYPOINT ["/usr/lib/postgresql/16/bin/postgres", "-D", "/etc/postgresql/16/main", "-c", "config_file=/etc/postgresql/16/main/postgresql.conf"]

View file

@ -9,7 +9,11 @@
services: services:
db: db:
image: timescale/timescaledb-postgis:latest-pg13 build:
context: .
dockerfile: Dockerfile.pg
platforms: ["linux/arm64"]
image: localhost/osint-dashboard-pg:latest
container_name: osint-db container_name: osint-db
restart: unless-stopped restart: unless-stopped
environment: environment:
@ -28,6 +32,7 @@ services:
nats: nats:
image: nats:2.10 image: nats:2.10
platform: linux/arm64
container_name: osint-nats container_name: osint-nats
restart: unless-stopped restart: unless-stopped
profiles: ["ingest"] profiles: ["ingest"]