forked from kartoza/docker-pg-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
FROM kartoza/postgis:11.0-2.5 | ||
FROM kartoza/postgis:12.1 | ||
MAINTAINER [email protected] | ||
|
||
RUN apt-get -y update; apt-get install -y postgresql-client | ||
RUN apt-get -y update; apt-get -y --no-install-recommends install postgresql-client cron | ||
RUN touch /var/log/cron.log | ||
|
||
COPY backups-cron /backups-cron | ||
COPY backups.sh /backups.sh | ||
COPY restore.sh /restore.sh | ||
COPY start.sh /start.sh | ||
RUN chmod 0755 /*.sh | ||
|
||
ENTRYPOINT ["/bin/bash", "/start.sh"] | ||
CMD ["/docker-entrypoint.sh"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
docker build -t kartoza/pg-backup:11.0 . | ||
docker build -t kartoza/pg-backup:12.0 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
# This is for testing on travis only | ||
# For production we recommend to rather use | ||
# image: kartoza/pg-backup | ||
# in the dbbackup service | ||
db: | ||
image: kartoza/postgis | ||
environment: | ||
- ALLOW_IP_RANGE=0.0.0.0/0 | ||
- POSTGRES_USER=docker | ||
- POSTGRES_PASS=docker | ||
|
||
dbbackup: | ||
build: . | ||
volumes: | ||
- ./backups:/backups | ||
environment: | ||
- DUMPPREFIX=watchkeeper | ||
# List databases to back up; defaults to all | ||
- "DBLIST=gis" | ||
# Remove backups older than (in days) | ||
- REMOVE_BEFORE=30 | ||
- POSTGRES_HOST=db | ||
- POSTGRES_DBNAME=gis | ||
- POSTGRES_USER=docker | ||
- POSTGRES_PASS=docker | ||
- POSTGRES_PORT=5432 | ||
# For restore script | ||
- TARGET_DB=gis | ||
- WITH_POSTGIS=1 | ||
- TARGET_ARCHIVE=/backups/target_archive.dmp | ||
links: | ||
- db:db | ||
version: '2.1' | ||
|
||
volumes: | ||
db-backups: | ||
geoserver-data: | ||
geo-db-data: | ||
|
||
services: | ||
db: | ||
image: kartoza/postgis:12.1 | ||
restart: on-failure | ||
healthcheck: | ||
test: "exit 0" | ||
|
||
db-dbbackups: | ||
build: | ||
context: . | ||
volumes: | ||
- ./backups:/backups | ||
environment: | ||
- DUMPPREFIX=PG_gis | ||
# List databases to back up; defaults to all | ||
# Remove backups older than (in days) | ||
- REMOVE_BEFORE=7 | ||
- POSTGRES_HOST=db | ||
- POSTGRES_DBNAME=gis | ||
- POSTGRES_USER=docker | ||
- POSTGRES_PASS=docker | ||
- POSTGRES_PORT=5432 | ||
# For restore script | ||
- TARGET_DB=gis | ||
- WITH_POSTGIS=1 | ||
- TARGET_ARCHIVE=/backups/target_archive.dmp | ||
restart: on-failure | ||
depends_on: | ||
db: | ||
condition: service_healthy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters