Mercurial > gemma
comparison docker/README.md @ 524:156a805941b5
Move docker stuff from schema to dedicated docker directory
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 27 Aug 2018 17:24:08 +0200 |
parents | schema/README@68fd656c3d55 |
children | 8f075ae6cf33 |
comparison
equal
deleted
inserted
replaced
523:e86d6e016bbb | 524:156a805941b5 |
---|---|
1 # Setup dev environment using Docker | |
2 | |
3 Run the `build` commands from the root of your checkout, because it is | |
4 assumed as the context! | |
5 | |
6 Other example commands, too, assume they are run from the root of your | |
7 checkout. | |
8 | |
9 ## Database setup | |
10 | |
11 - Build Dockerfile with e.g.: | |
12 ``` | |
13 docker build -t gemma_db -f docker/Dockerfile.db . | |
14 ``` | |
15 | |
16 - Get a running instance with e.g.: | |
17 ``` | |
18 docker run --name gemma_db -d -p 54321:5432 -v $PWD/schema:/opt/gemma \ | |
19 gemma_db | |
20 ``` | |
21 | |
22 - Run tests for RLS policies: | |
23 ``` | |
24 docker exec gemma_db ./run_tests.sh | |
25 ``` | |
26 | |
27 ## Create ER diagrams | |
28 | |
29 Assuming you have installed postgresql_autodoc and graphviz on a machine | |
30 from wich you can reach your docker host, you can use the following: | |
31 | |
32 - ER diagram with waterway related tables: | |
33 ``` | |
34 postgresql_autodoc -p 54321 -h $dockerhost \ | |
35 -d gemma -U sophie --password=so2Phie4 -t dot -l . -s 'waterway' | |
36 dot -Tpdf gemma.dot > gemma_waterway.pdf | |
37 ``` | |
38 | |
39 Omit the `-s` option to get a diagram with all tables or use any other | |
40 schema name to see other parts of the whole picture. |