A handy Docker container to periodically backup PostgreSQL to Alibaba Cloud OSS
576
This project provides Docker images to periodically back up a PostgreSQL database to Alibaba Cloud Object Storage Service (OSS).
Create a docker-compose.yml file with the following content:
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: dbname
backup:
image: isaced/postgres-backup-oss:latest
depends_on:
- postgres
environment:
SCHEDULE: '0 0 * * *' # optional, default '0 0 * * *' (daily)
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432 # optional, default 5432
POSTGRES_DATABASE: dbname
POSTGRES_USER: user
POSTGRES_PASSWORD: password
OSS_BUCKET_NAME: ${OSS_BUCKET_NAME}
OSS_REGION: ${OSS_REGION}
OSS_ACCESS_KEY_ID: ${OSS_ACCESS_KEY_ID}
OSS_ACCESS_KEY_SECRET: ${OSS_ACCESS_KEY_SECRET}
Then run docker-compose up -d to start the backup service.
You need to create an OSS bucket and an AccessKey pair in the Alibaba Cloud console. Then fill in the environment variables in the docker-compose.yml file.
About more OSS configuration, please refer to:Configure ossutil - Environment variables, just add to environment to take effect.
Github Repo: https://github.com/isaced/postgres-backup-oss
Content type
Image
Digest
sha256:39c9ad833…
Size
14.4 MB
Last updated
over 1 year ago
docker pull isaced/postgres-backup-oss