forked from railwayapp-templates/postgres-ssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.16
More file actions
21 lines (17 loc) · 819 Bytes
/
Dockerfile.16
File metadata and controls
21 lines (17 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ARG POSTGRES_VERSION=16
FROM postgres:${POSTGRES_VERSION}
# Install OpenSSL and sudo
RUN apt-get update && apt-get install -y openssl sudo
# Allow the postgres user to execute certain commands as root without a password
RUN echo "postgres ALL=(root) NOPASSWD: /usr/bin/mkdir, /bin/chown, /usr/bin/openssl" > /etc/sudoers.d/postgres
# Add init scripts while setting permissions
COPY --chmod=755 init-ssl.sh /docker-entrypoint-initdb.d/01-init-ssl.sh
COPY --chmod=755 init-realtime.sh /docker-entrypoint-initdb.d/02-init-realtime.sh
COPY --chmod=755 wrapper.sh /usr/local/bin/wrapper.sh
ENTRYPOINT ["wrapper.sh"]
# Set the command with the same postgres configuration
CMD ["postgres", \
"--port=5432", \
"-c", "wal_level=logical", \
"-c", "max_replication_slots=10", \
"-c", "max_wal_senders=10"]