Skip to content

Commit 3f82b5f

Browse files
committed
add docker-compose.yaml for development/testing
1 parent 0874c2a commit 3f82b5f

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!src/*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea
2+
.env

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ docker exec <container name> sh restore.sh <timestamp>
4949
## Build the image locally
5050
`ALPINE_VERSION` determines Postgres version compatibility. See [`build-and-push-images.yml`](.github/workflows/build-and-push-images.yml) for the latest mapping.
5151
```sh
52-
cd postgres-backup-s3
5352
docker build --build-arg ALPINE_VERSION=3.14
5453
```
54+
## Run a simple test environment with Docker Compose
55+
```sh
56+
cp template.env .env
57+
# fill out your secrets/params in .env
58+
docker compose up -d
59+
```
5560

5661
# Acknowledgements
5762
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).

docker-compose.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# this file is here to facilitate development/testing
2+
# $ docker compose up -d --build --force-recreate
3+
4+
services:
5+
postgres:
6+
image: postgres:14
7+
environment:
8+
POSTGRES_USER: user
9+
POSTGRES_PASSWORD: password
10+
11+
backup:
12+
build:
13+
context: .
14+
args:
15+
ALPINE_VERSION: '3.16'
16+
environment:
17+
SCHEDULE: '@weekly' # optional
18+
BACKUP_KEEP_DAYS: 7 # optional
19+
PASSPHRASE: passphrase # optional
20+
S3_REGION:
21+
S3_ACCESS_KEY_ID:
22+
S3_SECRET_ACCESS_KEY:
23+
S3_BUCKET:
24+
S3_PREFIX: backup
25+
POSTGRES_HOST: postgres
26+
POSTGRES_DATABASE: postgres
27+
POSTGRES_USER: user
28+
POSTGRES_PASSWORD: password

template.env

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
S3_REGION=""
2+
S3_ACCESS_KEY_ID=""
3+
S3_SECRET_ACCESS_KEY=""
4+
S3_BUCKET=""

0 commit comments

Comments
 (0)