mirror of
https://github.com/prodrigestivill/docker-postgres-backup-local.git
synced 2026-06-01 09:07:59 +00:00
Recommend runAsNonRoot in the examples (#29)
This commit is contained in:
@@ -12,7 +12,7 @@ Supports the following Docker architectures: `linux/amd64`, `linux/arm64`, `linu
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password prodrigestivill/postgres-backup-local
|
||||
docker run -u postgres:postgres -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password prodrigestivill/postgres-backup-local
|
||||
```
|
||||
|
||||
Docker Compose:
|
||||
@@ -31,6 +31,7 @@ services:
|
||||
pgbackups:
|
||||
image: prodrigestivill/postgres-backup-local
|
||||
restart: always
|
||||
user: postgres:postgres
|
||||
volumes:
|
||||
- /var/opt/pgbackups:/backups
|
||||
links:
|
||||
@@ -51,6 +52,8 @@ services:
|
||||
- HEALTHCHECK_PORT=80
|
||||
```
|
||||
|
||||
For security reasons it is recommended to run it as user `postgres:postgres`.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Most variables are the same as in the [official postgres image](https://hub.docker.com/_/postgres/).
|
||||
@@ -90,7 +93,7 @@ This variables are not intended to be used for normal deployment operations:
|
||||
By default this container makes daily backups, but you can start a manual backup by running `/backup.sh`:
|
||||
|
||||
```sh
|
||||
docker run -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password prodrigestivill/postgres-backup-local /backup.sh
|
||||
docker run -u postgres:postgres -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password prodrigestivill/postgres-backup-local /backup.sh
|
||||
```
|
||||
|
||||
### Automatic Periodic Backups
|
||||
|
||||
Reference in New Issue
Block a user