Skip to content

Commit

Permalink
ROX-19980 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludydoo committed Oct 27, 2023
1 parent eee741a commit 97cd483
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion image/db/rhel/Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ USER 70:70

ENV ROX_SLIM_MODE="true"

ENTRYPOINT ["docker-entrypoint.sh"]
COPY scripts/custom-entrypoint.sh /usr/local/bin/
COPY scripts/start-db.sh /usr/local/bin/

RUN /usr/local/bin/start-db.sh
USER root
RUN rm -rf /usr/local/bin/start-db.sh && \
rm -rf /docker-entrypoint-initdb.d/*
USER 70:70
ENV DATABASE_ALREADY_EXISTS=true
ENTRYPOINT ["custom-entrypoint.sh"]

EXPOSE 5432
CMD ["postgres", "-c", "config_file=/etc/postgresql.conf"]
2 changes: 1 addition & 1 deletion image/db/rhel/scripts/custom-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [ ! -d "/var/lib/postgresql/data/pgdata" ]; then
if [ -n "$POSTGRES_PASSWORD" ]; then
PGPASSWORD=postgres psql -c "ALTER USER postgres WITH PASSWORD '$POSTGRES_PASSWORD';"
elif [ -n "$POSTGRES_PASSWORD_FILE" ]; then
PGPASSWORD=$(cat "$POSTGRES_PASSWORD_FILE") psql -c "ALTER USER postgres WITH PASSWORD '$POSTGRES_PASSWORD';"
PGPASSWORD=postgres psql -c "ALTER USER postgres WITH PASSWORD '$(cat "$POSTGRES_PASSWORD_FILE")';"
fi

echo "Renaming postgres user if necessary..."
Expand Down

0 comments on commit 97cd483

Please sign in to comment.