summaryrefslogtreecommitdiffstats
path: root/pharos-dashboard/docker-compose.yml
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2017-07-26 11:22:54 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-07-26 16:36:16 -0700
commit4a6ee099cb28e575614a9a58da3da9019a3a03d2 (patch)
treeef8870b53cf19e6b6215f035e65825c165ab84c9 /pharos-dashboard/docker-compose.yml
parent43803375b8f30150026362fec4135f4eb8b75bd6 (diff)
Mount PostgreSQL Data from Persistent Volume
Each time the postgresql container is torn down the database is lost. By using a presistent volume managed outside of docker compose, the postgresql data can persist across updates and service restarts. The volume needs to exist before the postgres container can start: this is done with the 'make data' command. Note: postgres container creates a volume at /var/lib/postgresql/data. Mounting at this location ensures the data is persisted into the external volume. Change-Id: I958ba57fc735c594378d575bc7108bee0d30c1e3 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'pharos-dashboard/docker-compose.yml')
-rw-r--r--pharos-dashboard/docker-compose.yml5
1 files changed, 4 insertions, 1 deletions
diff --git a/pharos-dashboard/docker-compose.yml b/pharos-dashboard/docker-compose.yml
index 16b8c0f..44a263f 100644
--- a/pharos-dashboard/docker-compose.yml
+++ b/pharos-dashboard/docker-compose.yml
@@ -50,7 +50,7 @@ services:
env_file: config.env
volumes:
- ./config/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- - /var/lib/pharos_dashboard/postgresql:/var/lib/postgresql
+ - pharos-data:/var/lib/postgresql/data
rabbitmq:
restart: always
@@ -72,3 +72,6 @@ services:
- rabbitmq
volumes:
- ./:/pharos_dashboard
+volumes:
+ pharos-data:
+ external: true