https://github.com/muratgozel/postgresql-pgbackrest
Docker image for PostgreSQL with pgBackRest backup/restore tool.
https://github.com/muratgozel/postgresql-pgbackrest
docker dockerfile pgbackrest postgresql
Last synced: 3 months ago
JSON representation
Docker image for PostgreSQL with pgBackRest backup/restore tool.
- Host: GitHub
- URL: https://github.com/muratgozel/postgresql-pgbackrest
- Owner: muratgozel
- License: mit
- Created: 2021-09-08T11:08:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-27T02:22:51.000Z (over 4 years ago)
- Last Synced: 2025-01-30T21:34:42.969Z (12 months ago)
- Topics: docker, dockerfile, pgbackrest, postgresql
- Language: Dockerfile
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postgresql-pgbackrest
A docker file that installs postgresql along with pgbackrest. Image size is ~340MB
## Usage
A pgbackrest.conf file is required as you can find a sample of it inside the pgbackrest directory. Refer to the [pgbackrest documentation](https://pgbackrest.org/configuration.html) for configuration options.
This is a docker image and available on Github Packages. Just pull it. Sample docker-compose file:
```yaml
version: "3.9"
networks:
testnet:
driver: bridge
volumes:
pgbackrest_logs:
postgresql_data:
services:
postgresql:
container_name: postgres01
image: ghcr.io/muratgozel/postgresql-pgbackrest:latest
build:
context: ./postgresql
ports:
- "127.0.0.1:5432:5432"
volumes:
- './somedir/pgbackrest:/etc/pgbackrest'
- 'pgbackrest_logs:/var/log/pgbackrest'
- 'postgresql_data:/usr/local/pgsql/data'
networks:
- testnet
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
```
If you want store pgbackrest backups on the host machine add a volume:
```yml
- 'pgbackrest_data:/var/lib/pgbackrest'
```
Create a volume under data directory and execute some sql scripts inside of it.
```sh
docker exec postgres01 su-exec postgres psql -h 127.0.0.1 -U postgres -d [DBNAME] -f /data/schema.sql
```
---
Version management of this repository done by [releaser](https://github.com/muratgozel/node-releaser) 🚀