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>
stop:
docker-compose stop
+data:
+ docker volume create --name=pharos-data
+
shell-nginx:
docker exec -ti ng01 bash
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
- rabbitmq
volumes:
- ./:/pharos_dashboard
+volumes:
+ pharos-data:
+ external: true
- install docker, docker-compose and bower
- run 'bower install' in ./src/static/ to fetch javascript dependencies
- run 'make build' to build the containers
+- run 'make data'
- run 'make up' to run the dashboard
Updating:
Logs / Shell access:
-- there is some shortcuts in the makefile
\ No newline at end of file
+- there is some shortcuts in the makefile