mirror of
https://github.com/garraflavatra/docker-volume-s3-backup.git
synced 2025-05-17 13:14:38 +00:00
add docker-compose.yaml for development/testing
This commit is contained in:
parent
0874c2abfb
commit
3f82b5fc12
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!src/*
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.env
|
@ -49,9 +49,14 @@ docker exec <container name> sh restore.sh <timestamp>
|
|||||||
## Build the image locally
|
## Build the image locally
|
||||||
`ALPINE_VERSION` determines Postgres version compatibility. See [`build-and-push-images.yml`](.github/workflows/build-and-push-images.yml) for the latest mapping.
|
`ALPINE_VERSION` determines Postgres version compatibility. See [`build-and-push-images.yml`](.github/workflows/build-and-push-images.yml) for the latest mapping.
|
||||||
```sh
|
```sh
|
||||||
cd postgres-backup-s3
|
|
||||||
docker build --build-arg ALPINE_VERSION=3.14
|
docker build --build-arg ALPINE_VERSION=3.14
|
||||||
```
|
```
|
||||||
|
## Run a simple test environment with Docker Compose
|
||||||
|
```sh
|
||||||
|
cp template.env .env
|
||||||
|
# fill out your secrets/params in .env
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
# Acknowledgements
|
# Acknowledgements
|
||||||
This project is a fork and re-structuring of @schickling's [postgres-backup-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-backup-s3) and [postgres-restore-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-restore-s3).
|
This project is a fork and re-structuring of @schickling's [postgres-backup-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-backup-s3) and [postgres-restore-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-restore-s3).
|
||||||
|
28
docker-compose.yaml
Normal file
28
docker-compose.yaml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# this file is here to facilitate development/testing
|
||||||
|
# $ docker compose up -d --build --force-recreate
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:14
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: user
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
|
||||||
|
backup:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
ALPINE_VERSION: '3.16'
|
||||||
|
environment:
|
||||||
|
SCHEDULE: '@weekly' # optional
|
||||||
|
BACKUP_KEEP_DAYS: 7 # optional
|
||||||
|
PASSPHRASE: passphrase # optional
|
||||||
|
S3_REGION:
|
||||||
|
S3_ACCESS_KEY_ID:
|
||||||
|
S3_SECRET_ACCESS_KEY:
|
||||||
|
S3_BUCKET:
|
||||||
|
S3_PREFIX: backup
|
||||||
|
POSTGRES_HOST: postgres
|
||||||
|
POSTGRES_DATABASE: postgres
|
||||||
|
POSTGRES_USER: user
|
||||||
|
POSTGRES_PASSWORD: password
|
4
template.env
Normal file
4
template.env
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
S3_REGION=""
|
||||||
|
S3_ACCESS_KEY_ID=""
|
||||||
|
S3_SECRET_ACCESS_KEY=""
|
||||||
|
S3_BUCKET=""
|
Loading…
x
Reference in New Issue
Block a user