Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(db): inherit from scl image, enforce PG_ENCRYPT_KEY #129

Merged
merged 19 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# FROM registry.redhat.io/rhel8/postgresql-15:latest
FROM docker.io/library/postgres:15
COPY ./pgcrypto.sql /docker-entrypoint-initdb.d/

RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/postgres-entrypoint.sh

ENTRYPOINT ["/usr/local/bin/cryostat-db-entrypoint.bash"]

COPY ./pgcrypto.sql /docker-entrypoint-initdb.d/pgcrypto.sql
COPY ./entrypoint.bash /usr/local/bin/cryostat-db-entrypoint.bash
12 changes: 12 additions & 0 deletions db/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

if [ "${DEBUG}" = "true" ]; then
set -xEeo pipefail
fi

if [ -z "${PG_ENCRYPT_KEY}" ]; then
echo "\$PG_ENCRYPT_KEY must be set and non-empty."
exit 1
fi

exec /usr/local/bin/postgres-entrypoint.sh postgres -c encrypt.key="${PG_ENCRYPT_KEY}" "$@"
6 changes: 0 additions & 6 deletions smoketest/compose/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ services:
db:
image: quay.io/cryostat/cryostat3-db:dev
build: ../../db
entrypoint:
- /usr/local/bin/docker-entrypoint.sh
command:
- postgres
- -c
- encrypt.key=REPLACEME
hostname: db
expose:
- "5432"
Expand Down
Loading