-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (19 loc) · 882 Bytes
/
Dockerfile
File metadata and controls
24 lines (19 loc) · 882 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
FROM postgres:13-bookworm
# Tools used by the dump-load script
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Defaults for the postgres official entrypoint:
# POSTGRES_HOST_AUTH_METHOD=trust → no superuser password required
# POSTGRES_DB=postgres → default db at initdb time
ENV POSTGRES_HOST_AUTH_METHOD=trust \
POSTGRES_DB=postgres \
PGDATA=/var/lib/postgresql/data
COPY config/postgresql.conf /etc/postgresql/postgresql.conf
COPY config/pg_hba.conf /etc/postgresql/pg_hba.conf
COPY scripts/init/ /docker-entrypoint-initdb.d/
COPY scripts/healthcheck.sh /usr/local/bin/healthcheck.sh
HEALTHCHECK --interval=30s --timeout=5s --start-period=6h --retries=5 \
CMD /usr/local/bin/healthcheck.sh
EXPOSE 5432
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]