Skip to content

Commit

Permalink
feat(database): configurable pgbackrest conf
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Nov 23, 2023
1 parent 2a1bc7f commit c0db077
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ POSTGRES_USER=postgres
POSTGRES_DB=heltin
POSTGRES_PORT=54321
POSTGRES_PASSWORD=wowmuchsecret
PGBACKREST_CONF_PATH=./database/pgbackrest.conf

# graphql
POSTGRES_SCHEMAS=public
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-deploy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
required: true
POSTGRES_PASSWORD:
required: true
PGBACKREST_CONF_PATH:
required: true

jobs:
deploy:
Expand Down Expand Up @@ -62,4 +64,5 @@ jobs:
APP_DOMAINS: ${{ secrets.APP_DOMAINS }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
PGBACKREST_CONF_PATH: ${{ secrets.PGBACKREST_CONF_PATH }}
run: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --wait
3 changes: 1 addition & 2 deletions database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ RUN rm -rf /tmp/pgbackrest-release && \
RUN apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

# configure pgBackRest
COPY --chown=postgres:postgres database/pgbackrest.conf $PGBACKREST_CONFIG_PATH
# configure Postgres for pgBackRest
COPY --chown=postgres:postgres database/pgbackrest.postgresql.conf $PGBACKREST_CONFIG_PATH
RUN cat $PGBACKREST_CONFIG_PATH/pgbackrest.postgresql.conf >> /usr/share/postgresql/postgresql.conf.sample

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
volumes:
- database-data:/var/lib/postgresql/data
- pgbackrest-repo:/var/lib/pgbackrest
- ${PGBACKREST_CONF_PATH}:/etc/pgbackrest/pgbackrest.conf
healthcheck:
test: psql --set=ON_ERROR_STOP=1 --username=$$POSTGRES_USER --dbname=$$POSTGRES_DB --command='select 1 from public.user;' > /dev/null 2>&1 || exit 1
interval: 7s
Expand Down

0 comments on commit c0db077

Please sign in to comment.