DB 적재 초기구조

This commit is contained in:
Lectom C Han
2025-12-09 13:51:25 +09:00
parent fa1a7a057e
commit ecaca02400
11 changed files with 498 additions and 73 deletions

25
Dockerfile.postgres Normal file
View File

@@ -0,0 +1,25 @@
FROM postgres:16-bookworm AS builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
git \
libmaxminddb-dev \
postgresql-server-dev-16 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /tmp/maxminddb_fdw
RUN git clone https://github.com/klayemore/maxminddb_fdw.git . && \
make && \
make install
FROM postgres:16-bookworm
COPY --from=builder /usr/lib/postgresql/16/lib/maxminddb_fdw.so /usr/lib/postgresql/16/lib/maxminddb_fdw.so
COPY --from=builder /usr/share/postgresql/16/extension/maxminddb_fdw* /usr/share/postgresql/16/extension/
RUN mkdir -p /data && chown postgres:postgres /data
ENV POSTGRES_DB=geoip
ENV POSTGRES_USER=geoip_admin
ENV POSTGRES_PASSWORD=geoip_admin