| IMAGE_NAME:=xosproject/xos-postgres |
| CONTAINER_NAME:=xos-db-postgres |
| build: ; docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} . |
| run: ; docker run -d -p 5432:5432 --name ${CONTAINER_NAME} ${IMAGE_NAME} |
| stop: ; docker stop ${CONTAINER_NAME} |
| rm: ; docker rm ${CONTAINER_NAME} |
| rmi: ; docker rmi ${IMAGE_NAME} |
| backupvol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres tar cvf /backup/backup-postgres.tar /var/lib/postgresql |
| restorevol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres cd /var/lib/postgresql && tar xvf /backup/backup-postgres.tar |