Mercurial > gemma
annotate docker/README.md @ 2142:70471052f6b0
docker/README.md: Formatting, typos and concretizations.
author | Bjoern Schilberg <bjoern@intevation.de> |
---|---|
date | Thu, 07 Feb 2019 13:45:43 +0100 |
parents | a7e47a9d890b |
children | b6b699385302 |
rev | line source |
---|---|
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
1 # Setup dev environment using Docker |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
2 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
3 - [Setup dev environment using Docker](#setup-dev-environment-using-docker) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
4 - [Network setup](#network-setup) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
5 - [Database setup](#database-setup) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
6 - [Create ER diagrams](#create-er-diagrams) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
7 - [GeoServer setup](#geoserver-setup) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
8 - [Gemma backend setup](#gemma-backend-setup) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
9 - [SPA setup](#spa-setup) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
10 |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
11 Run the `build` commands from the root of your checkout, because it is |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
12 assumed as the context! |
36 | 13 |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
14 Other example commands, too, assume they are run from the root of your |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
15 checkout. |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
16 |
712
86725b39b2d2
Improve reproducability of documented docker commands
Tom Gottfried <tom@intevation.de>
parents:
596
diff
changeset
|
17 ## Network setup |
86725b39b2d2
Improve reproducability of documented docker commands
Tom Gottfried <tom@intevation.de>
parents:
596
diff
changeset
|
18 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
19 Create a network to connect containers: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
20 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
21 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
22 docker network create gemma |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
23 ``` |
712
86725b39b2d2
Improve reproducability of documented docker commands
Tom Gottfried <tom@intevation.de>
parents:
596
diff
changeset
|
24 |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
25 ## Database setup |
36 | 26 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
27 Build `gemma_db` docker image with e.g.: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
28 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
29 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
30 docker build -t gemma_db -f docker/Dockerfile.db . |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
31 ``` |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
32 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
33 Get a running instance with e.g.: |
101 | 34 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
35 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
36 docker run --name gemma_db -d -p 54321:5432 -v $PWD/schema:/opt/gemma \ |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
37 --network gemma gemma_db |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
38 ``` |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
39 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
40 Use `--network-alias gemma_db` if your container has a different name |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
41 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
42 Run tests for [Row-Level Security](https://www.postgresql.org/docs/11/ddl-rowsecurity.html) (RLS) |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
43 policies: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
44 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
45 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
46 docker exec gemma_db ./run_tests.sh |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
47 ``` |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
48 |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
49 ## Create ER diagrams |
83 | 50 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
51 Assuming you have installed `postgresql-autodoc` and |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
52 [graphviz](http://graphviz.org/) on a machine from which you can reach your |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
53 docker host, you can use the following: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
54 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
55 ER diagram with waterway related tables: |
83 | 56 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
57 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
58 postgresql_autodoc -p 54321 -h $dockerhost \ |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
59 -d gemma -U sophie --password=so2Phie4 \ |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
60 -t dot -l . -s 'waterway' |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
61 dot -Tpdf gemma.dot > gemma_waterway.pdf |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
62 ``` |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
63 |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
64 Omit the `-s` option to get a diagram with all tables or use any other |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
174
diff
changeset
|
65 schema name to see other parts of the whole picture. |
561
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
66 |
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
67 ## GeoServer setup |
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
68 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
69 Build `gemma_geoserver` docker image with e.g.: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
70 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
71 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
72 docker build -t gemma_geoserver -f docker/Dockerfile.geoserv . |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
73 ``` |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
74 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
75 Get a running instance with e.g.: |
561
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
76 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
77 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
78 docker run --name gemma_geoserver -d -p 8280:8080 --network gemma \ |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
79 gemma_geoserver |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
80 ``` |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
81 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
82 Use `--network-alias gemma_geoserver` if you give your container |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
83 a different name. |
561
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
84 |
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
85 ## Gemma backend setup |
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
86 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
87 Build `gemma_backend` docker image with e.g.: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
88 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
89 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
90 docker build -t gemma_backend -f docker/Dockerfile.backend . |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
91 ``` |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
92 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
93 Get a running instance with e.g.: |
561
8f075ae6cf33
Improve docker usage and related docs
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
94 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
95 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
96 docker run --name gemma_backend -v $PWD:/opt/gemma -d -p 8200:8000 \ |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
97 --network gemma gemma_backend |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
98 ``` |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
99 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
100 Use `--network-alias gemma_backend` if you give your container |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
101 a different name. |
596
6d7c0dbf9d21
Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents:
561
diff
changeset
|
102 |
6d7c0dbf9d21
Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents:
561
diff
changeset
|
103 ## SPA setup |
6d7c0dbf9d21
Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents:
561
diff
changeset
|
104 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
105 Build `gemma_spa` docker image with e.g.: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
106 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
107 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
108 docker build -t gemma_spa -f docker/Dockerfile.spa . |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
109 ``` |
596
6d7c0dbf9d21
Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents:
561
diff
changeset
|
110 |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
111 Get a running instance with e.g.: |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
112 |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
113 ```shell |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
114 docker run --name gemma_spa -v $PWD/client:/opt/gemma/client -d -p 8290:8080 \ |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
115 --network gemma gemma_spa |
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
116 ``` |
596
6d7c0dbf9d21
Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents:
561
diff
changeset
|
117 |
6d7c0dbf9d21
Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents:
561
diff
changeset
|
118 Now you should be able to use the application in your browser by going to |
2142
70471052f6b0
docker/README.md: Formatting, typos and concretizations.
Bjoern Schilberg <bjoern@intevation.de>
parents:
1982
diff
changeset
|
119 `http://HOSTNAME:8290`, with `HOSTNAME` being the hostname of your docker host. |