blob: ed939d5e665a3e802067cde8f47804bc16eb376a [file] [log] [blame]
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -08001IMAGE_NAME:=xosproject/xos-postgress
2CONTAINER_NAME:=xos-db-postgress
3
Tony Mack8a261c62015-10-29 21:14:41 +00004.PHONY: build
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -08005build: ; docker build --rm -t ${IMAGE_NAME} .
Tony Mack8a261c62015-10-29 21:14:41 +00006
7.PHONY: run
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -08008run: ; docker run -d -p 5432:5432 --name ${CONTAINER_NAME} ${IMAGE_NAME}
Tony Mack8a261c62015-10-29 21:14:41 +00009
10.PHONY: stop
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -080011stop: ; docker stop ${CONTAINER_NAME}
Tony Mack8a261c62015-10-29 21:14:41 +000012
13.PHONY: rm
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -080014rm: ; docker rm ${CONTAINER_NAME}
Tony Mack8a261c62015-10-29 21:14:41 +000015
16.PHONE: rmi
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -080017rmi: ; docker rmi ${IMAGE_NAME}
Tony Mack8a261c62015-10-29 21:14:41 +000018
19.PHONY: backup
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -080020backupvol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres tar cvf /backup/backup-postgres.tar /var/lib/postgresql
Tony Mack8a261c62015-10-29 21:14:41 +000021
22.PHONY: restore
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -080023restorevol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres cd /var/lib/postgresql && tar xvf /backup/backup-postgres.tar
Tony Mack8a261c62015-10-29 21:14:41 +000024