-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.postgres
More file actions
30 lines (24 loc) · 1006 Bytes
/
Dockerfile.postgres
File metadata and controls
30 lines (24 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use official Postgres 13 image
FROM postgres:13
# Install basic tools
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# Add PostgreSQL official repository
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Install build dependencies for pg_sheet_fdw and pgxnclient
RUN apt-get update && apt-get install -y \
build-essential \
postgresql-server-dev-13 \
pgxnclient \
&& rm -rf /var/lib/apt/lists/*
# Install pg_sheet_fdw via PGXN
RUN pgxn install pg_sheet_fdw
# Copy initialization script for persistent data loading
COPY init-db.sh /docker-entrypoint-initdb.d/init-db.sh
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh
# The official postgres image already defines ENTRYPOINT and CMD