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
Some checks failed
build-and-deploy / build (push) Failing after 17s
This commit is contained in:
parent
3d53ed2c1c
commit
14a9178f8c
2 changed files with 38 additions and 1 deletions
32
Dockerfile.pg
Normal file
32
Dockerfile.pg
Normal 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"]
|
||||
|
|
@ -9,7 +9,11 @@
|
|||
|
||||
services:
|
||||
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
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
|
@ -28,6 +32,7 @@ services:
|
|||
|
||||
nats:
|
||||
image: nats:2.10
|
||||
platform: linux/arm64
|
||||
container_name: osint-nats
|
||||
restart: unless-stopped
|
||||
profiles: ["ingest"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue