Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Commit 6e8da3a

Browse files
committed
Postgres
- In-project documentation Documentation - fixes for healthcheck documentation
1 parent d415d29 commit 6e8da3a

6 files changed

Lines changed: 91 additions & 11 deletions

File tree

src/database/mariadb/v1/template/documentation/docker/implemented_configuration.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The following configuration has been implemented by ProjectInit:
44

55
* Database credentials as Docker compose secrets.
66
* Docker volume is used for persisting data on the host.
7-
* Healthcheck is implemented in Docker Compose.
7+
* Healthcheck is implemented directly in the Docker image (custom Dockerfile).
88
* Custom `my.cnf` MariaDB configuration file and directory are prepared.
99
1010
=== Configuration files
@@ -50,13 +50,13 @@ Resources:
5050

5151
=== Healthcheck
5252

53-
Official MariaDB healthcheck script is implemented in Docker Compose. It makes sure that the MariaDB container is up
53+
Basic healthcheck mechanism has been implemented in the custom Dockerfile. It makes sure that the database service is up
5454
before allowing your application to run.
5555

5656
Resources:
5757

5858
* link:https://mariadb.com/kb/en/using-healthcheck-sh/[`healthcheck.sh` Official MariaDB documentation]
59-
* link:https://docs.docker.com/reference/compose-file/services/#healthcheck[Healthcheck Docker service property]
59+
* link:https://docs.docker.com/reference/dockerfile/#healthcheck[Healthcheck in Dockerfile]
6060

6161
=== Custom MariaDB configuration
6262

src/database/mysql/v1/template/documentation/docker/implemented_configuration.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The following configuration has been implemented by ProjectInit:
44

55
* Database credentials as Docker compose secrets.
66
* Docker volume is used for persisting data on the host.
7-
* Healthcheck is implemented in Docker Compose.
7+
* Healthcheck is implemented directly in the Docker image (custom Dockerfile).
88
* Custom `my.cnf` MySQL configuration file and directory are prepared.
99
1010
=== Configuration files
@@ -50,12 +50,12 @@ Resources:
5050

5151
=== Healthcheck
5252

53-
Basic healthcheck mechanism has been implemented in Docker Compose. It makes sure that the MySQL container is up before
54-
allowing your application to run.
53+
Basic healthcheck mechanism has been implemented in the custom Dockerfile. It makes sure that the database service is up
54+
before allowing your application to run.
5555

5656
Resources:
5757

58-
* link:https://docs.docker.com/reference/compose-file/services/#healthcheck[Healthcheck Docker service property]
58+
* link:https://docs.docker.com/reference/dockerfile/#healthcheck[Healthcheck in Dockerfile]
5959

6060
=== Custom MySQL configuration
6161

src/database/percona/v1/template/documentation/docker/implemented_configuration.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The following configuration has been implemented by ProjectInit:
44

55
* Database credentials as Docker compose secrets.
66
* Docker volume is used for persisting data on the host.
7-
* Healthcheck is implemented in Docker Compose.
7+
* Healthcheck is implemented directly in the Docker image (custom Dockerfile).
88
* Custom `my.cnf` MySQL configuration file and directory are prepared.
99
* Default authentication is set to non-deprecated `caching_sha2_password` method for both MySQL daemon and client.
1010
* Percona telemetry is disabled.
@@ -52,12 +52,12 @@ Resources:
5252

5353
=== Healthcheck
5454

55-
Basic healthcheck mechanism has been implemented in Docker Compose. It makes sure that the Percona MySQL container is
56-
up before allowing your application to run.
55+
Basic healthcheck mechanism has been implemented in the custom Dockerfile. It makes sure that the database service is up
56+
before allowing your application to run.
5757

5858
Resources:
5959

60-
* link:https://docs.docker.com/reference/compose-file/services/#healthcheck[Healthcheck Docker service property]
60+
* link:https://docs.docker.com/reference/dockerfile/#healthcheck[Healthcheck in Dockerfile]
6161

6262
=== Custom MySQL configuration
6363

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
== Implemented configuration
2+
3+
The following configuration has been implemented by ProjectInit:
4+
5+
* Database credentials as Docker compose secrets.
6+
* Docker volume is used for persisting data on the host.
7+
* Healthcheck is implemented directly in the Docker image (custom Dockerfile).
8+
9+
=== Configuration files
10+
11+
* Database credentials (Docker Compose secrets):
12+
** link:../../compose_secrets/postgres_db.txt[`compose_secrets/postgres_db.txt`]
13+
** link:../../compose_secrets/postgres_password.txt[`compose_secrets/postgres_password.txt`]
14+
** link:../../compose_secrets/postgres_user.txt[`compose_secrets/postgres_user.txt`]
15+
* Dockerfile:
16+
** link:../../projectinit_docker/dev/pgsql/Dockerfile[`projectinit_docker/dev/pgsql/Dockerfile`]
17+
** link:../../projectinit_docker/prod/pgsql/Dockerfile[`projectinit_docker/prod/pgsql/Dockerfile`]
18+
19+
=== Database credentials
20+
21+
Database credentials are stored as Docker Compose secrets. The secrets are available in
22+
link:../../compose_secrets[`compose_secrets`] directory of your project.
23+
24+
Resources:
25+
26+
* link:https://docs.docker.com/compose/how-tos/use-secrets/[How to use secrets in Docker Compose]
27+
28+
=== Persisting data on the host
29+
30+
Docker volume is used for persisting data on the host. This is the default method recommended in the documentation of
31+
the official Docker image. Volume file and directory permissions are managed by Docker. You are free to mount a local
32+
directory instead (bind mount), however, you will need to set up the directory, its owner (user), permissions and other
33+
security mechanisms yourself.
34+
35+
Resources:
36+
37+
* link:https://docs.docker.com/engine/storage/volumes/[Docker Volumes]
38+
* link:https://docs.docker.com/engine/storage/bind-mounts/[Docker bind mounts]
39+
40+
=== Healthcheck
41+
42+
Basic healthcheck mechanism has been implemented in the custom Dockerfile. It makes sure that the database service is up
43+
before allowing your application to run.
44+
45+
Resources:
46+
47+
* link:https://docs.docker.com/reference/dockerfile/#healthcheck[Healthcheck in Dockerfile]
48+
* link:https://www.postgresql.org/docs/current/app-pg-isready.html[`pg_isready`]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
= PostgreSQL
2+
:toc:
3+
:toclevels: 5
4+
5+
== Introduction
6+
7+
|===
8+
|Description|Link
9+
10+
|Homepage
11+
|https://www.postgresql.org/
12+
13+
|Docker Official image (used here)
14+
|https://hub.docker.com/_/postgres
15+
16+
|===
17+
18+
[IMPORTANT]
19+
====
20+
PostgreSQL server has been set up with *minimum configuration only*, so you can start working. It's up to you how you'd
21+
like to configure it for development and production.
22+
====
23+
24+
~~~implemented configuration~~~

src/tools/documentation/documentation.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ setup_documentation() {
1010

1111
setup_database_documentation() {
1212
case $projectinit_database_type in
13+
"pgsql" )
14+
cp -f "${tool_dir}/src/database/pgsql/container/docker/v1/template/documentation/index.adoc" "${project_root_dir}/doc/projectinit/postgresql.adoc"
15+
case $projectinit_container_type in
16+
"docker" )
17+
perl -pi -e "s/~~~implemented configuration~~~/$(<"${tool_dir}/src/database/pgsql/container/docker/v1/template/documentation/implemented_configuration.adoc" perl -pe 's/([\/\& \t])/\\$1/g')/g" "${project_root_dir}/doc/projectinit/postgresql.adoc"
18+
;;
19+
esac
20+
;;
1321
"percona" )
1422
cp -f "${tool_dir}/src/database/percona/v1/template/documentation/index.adoc" "${project_root_dir}/doc/projectinit/percona_mysql.adoc"
1523
case $projectinit_container_type in

0 commit comments

Comments
 (0)