Skip to content

Commit 7ce64e4

Browse files
committed
Добавил поддержку переменной окружения APP_DB - создание БД для приложения
1 parent f0fa5ad commit 7ce64e4

22 files changed

+172
-21
lines changed

12/docker-postgres/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,33 @@ COPY ./postgres /usr/local/sbin
131131
RUN chmod +x /usr/local/bin/*.sh \
132132
&& chmod +x /usr/local/sbin/postgres \
133133
&& chmod +x /docker-entrypoint-initdb.d/*.sh
134+
135+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
136+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
137+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
138+
# flush tables to disk, which is the best compromise available to avoid data
139+
# corruption.
140+
#
141+
# Users who know their applications do not keep open long-lived idle connections
142+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
143+
# Shutdown mode" in which any existing sessions are allowed to finish and the
144+
# server stops when all sessions are terminated.
145+
#
146+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
147+
# about available PostgreSQL server shutdown signals.
148+
#
149+
# See also https://www.postgresql.org/docs/12/server-start.html for further
150+
# justification of this as the default value, namely that the example (and
151+
# shipped) systemd service files use the "Fast Shutdown mode" for service
152+
# termination.
153+
#
154+
STOPSIGNAL SIGINT
155+
#
156+
# An additional setting that is recommended for all users regardless of this
157+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
158+
# equivalent) for controlling how long to wait between sending the defined
159+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
160+
#
161+
# The default in most runtimes (such as Docker) is 10 seconds, and the
162+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
163+
# that even 90 seconds may not be long enough in many instances.

12/docker-postgres/initdb-extension.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,29 @@ fi
5151

5252
psql -c "select pg_reload_conf();"
5353

54-
# Create the 'template_extension' template db
55-
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD"
54+
# Create the 'template_extension' template DB and application DB
55+
if [ "$APP_DB" != "" ]; then
56+
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD" -v APP_DB="$APP_DB"
57+
else
58+
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD"
59+
fi
5660

5761
# Load extension into template_extension database and $POSTGRES_DB
58-
for DB in "$POSTGRES_DB" template_extension ; do
62+
for DB in "$POSTGRES_DB" template_extension "$APP_DB" ; do
63+
if [ -n "$DB" ]; then
5964
echo "Loading extensions into $DB"
6065

61-
psql --dbname="$DB" -f /usr/local/bin/db_all.sql -v email_server=\"$EMAIL_SERVER\"
66+
psql --dbname="$DB" -f /usr/local/bin/db_all.sql -v email_server="$EMAIL_SERVER"
6267

6368
if [ "$DB" = "postgres" ] ; then
64-
psql --dbname="$DB" -f /usr/local/bin/db_postgres.sql -v email_server=\"$EMAIL_SERVER\"
69+
psql --dbname="$DB" -f /usr/local/bin/db_postgres.sql -v email_server="$EMAIL_SERVER"
6570
else
66-
psql --dbname="$DB" -f /usr/local/bin/db_notpostgres.sql -v IS_SETUPDB=false -v DEV_SCHEMA="$DEV_SCHEMA" -v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -v email_server=\"$EMAIL_SERVER\"
71+
psql --dbname="$DB" -f /usr/local/bin/db_notpostgres.sql -v IS_SETUPDB=false -v DEV_SCHEMA="$DEV_SCHEMA" -v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -v email_server="$EMAIL_SERVER"
72+
if [ "$DB" != "template_extension" ] ; then
73+
psql --dbname="$DB" -f /usr/local/bin/db_target.sql -v DEV_SCHEMA="$DEV_SCHEMA" -v email_server="$EMAIL_SERVER"
74+
fi
6775
fi
76+
fi
6877
done
6978

7079
psql -f /usr/local/bin/post.sql

12/docker-postgres/pre.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ select not exists(select true FROM pg_catalog.pg_database where datname='templat
99
CREATE DATABASE template_extension IS_TEMPLATE true;
1010
\endif
1111

12+
\if :{?APP_DB}
13+
select not exists(select true FROM pg_catalog.pg_database where datname = :'APP_DB') as is_check
14+
\gset
15+
\if :is_check
16+
CREATE DATABASE :"APP_DB";
17+
\endif
18+
\endif
19+
1220
-- create role deploy
1321
-- роль для деплоя, т.е. все объекты в БД должны быть созданы от нее, а не от пользователя postgres (sa)
1422
select not exists(select true FROM pg_catalog.pg_roles where rolname ilike '%deploy%') as is_check

12/docker_start_12.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
docker run --name my_postgres_12 --shm-size 2147483648 -p 5433:5432/tcp \
2+
docker run --rm --name my_postgres_12 --shm-size 2147483648 -p 5433:5432/tcp \
33
-v /var/lib/pgsql/12_1/data:/var/lib/postgresql/data \
44
-v /var/log/postgresql1:/var/log/postgresql \
55
-v /mnt/pgbak2/:/mnt/pgbak \

12/postgres-service.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

12/postgres-service_all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

12/postgres-service_pgb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

13/docker-postgres/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,33 @@ COPY ./postgres /usr/local/sbin
131131
RUN chmod +x /usr/local/bin/*.sh \
132132
&& chmod +x /usr/local/sbin/postgres \
133133
&& chmod +x /docker-entrypoint-initdb.d/*.sh
134+
135+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
136+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
137+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
138+
# flush tables to disk, which is the best compromise available to avoid data
139+
# corruption.
140+
#
141+
# Users who know their applications do not keep open long-lived idle connections
142+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
143+
# Shutdown mode" in which any existing sessions are allowed to finish and the
144+
# server stops when all sessions are terminated.
145+
#
146+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
147+
# about available PostgreSQL server shutdown signals.
148+
#
149+
# See also https://www.postgresql.org/docs/12/server-start.html for further
150+
# justification of this as the default value, namely that the example (and
151+
# shipped) systemd service files use the "Fast Shutdown mode" for service
152+
# termination.
153+
#
154+
STOPSIGNAL SIGINT
155+
#
156+
# An additional setting that is recommended for all users regardless of this
157+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
158+
# equivalent) for controlling how long to wait between sending the defined
159+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
160+
#
161+
# The default in most runtimes (such as Docker) is 10 seconds, and the
162+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
163+
# that even 90 seconds may not be long enough in many instances.

13/docker-postgres/initdb-extension.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,29 @@ fi
5151

5252
psql -c "select pg_reload_conf();"
5353

54-
# Create the 'template_extension' template db
55-
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD"
54+
# Create the 'template_extension' template DB and application DB
55+
if [ "$APP_DB" != "" ]; then
56+
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD" -v APP_DB="$APP_DB"
57+
else
58+
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD"
59+
fi
5660

5761
# Load extension into template_extension database and $POSTGRES_DB
58-
for DB in "$POSTGRES_DB" template_extension ; do
62+
for DB in "$POSTGRES_DB" template_extension "$APP_DB" ; do
63+
if [ -n "$DB" ]; then
5964
echo "Loading extensions into $DB"
6065

61-
psql --dbname="$DB" -f /usr/local/bin/db_all.sql -v email_server=\"$EMAIL_SERVER\"
66+
psql --dbname="$DB" -f /usr/local/bin/db_all.sql -v email_server="$EMAIL_SERVER"
6267

6368
if [ "$DB" = "postgres" ] ; then
64-
psql --dbname="$DB" -f /usr/local/bin/db_postgres.sql -v email_server=\"$EMAIL_SERVER\"
69+
psql --dbname="$DB" -f /usr/local/bin/db_postgres.sql -v email_server="$EMAIL_SERVER"
6570
else
66-
psql --dbname="$DB" -f /usr/local/bin/db_notpostgres.sql -v IS_SETUPDB=false -v DEV_SCHEMA="$DEV_SCHEMA" -v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -v email_server=\"$EMAIL_SERVER\"
71+
psql --dbname="$DB" -f /usr/local/bin/db_notpostgres.sql -v IS_SETUPDB=false -v DEV_SCHEMA="$DEV_SCHEMA" -v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -v email_server="$EMAIL_SERVER"
72+
if [ "$DB" != "template_extension" ] ; then
73+
psql --dbname="$DB" -f /usr/local/bin/db_target.sql -v DEV_SCHEMA="$DEV_SCHEMA" -v email_server="$EMAIL_SERVER"
74+
fi
6775
fi
76+
fi
6877
done
6978

7079
psql -f /usr/local/bin/post.sql

13/docker-postgres/pre.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ select not exists(select true FROM pg_catalog.pg_database where datname='templat
99
CREATE DATABASE template_extension IS_TEMPLATE true;
1010
\endif
1111

12+
\if :{?APP_DB}
13+
select not exists(select true FROM pg_catalog.pg_database where datname = :'APP_DB') as is_check
14+
\gset
15+
\if :is_check
16+
CREATE DATABASE :"APP_DB";
17+
\endif
18+
\endif
19+
1220
-- create role deploy
1321
-- роль для деплоя, т.е. все объекты в БД должны быть созданы от нее, а не от пользователя postgres (sa)
1422
select not exists(select true FROM pg_catalog.pg_roles where rolname ilike '%deploy%') as is_check

13/docker_start_13.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
docker run --name my_postgres_13 --shm-size 2147483648 -p 5433:5432/tcp \
2+
docker run --rm --name my_postgres_13 --shm-size 2147483648 -p 5433:5432/tcp \
33
-v /var/lib/pgsql/13_1/data:/var/lib/postgresql/data \
44
-v /var/log/postgresql1:/var/log/postgresql \
55
-v /mnt/pgbak2/:/mnt/pgbak \

13/postgres-service.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

13/postgres-service_all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

13/postgres-service_pgb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

14/docker-postgres/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,33 @@ COPY ./postgres /usr/local/sbin
131131
RUN chmod +x /usr/local/bin/*.sh \
132132
&& chmod +x /usr/local/sbin/postgres \
133133
&& chmod +x /docker-entrypoint-initdb.d/*.sh
134+
135+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
136+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
137+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
138+
# flush tables to disk, which is the best compromise available to avoid data
139+
# corruption.
140+
#
141+
# Users who know their applications do not keep open long-lived idle connections
142+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
143+
# Shutdown mode" in which any existing sessions are allowed to finish and the
144+
# server stops when all sessions are terminated.
145+
#
146+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
147+
# about available PostgreSQL server shutdown signals.
148+
#
149+
# See also https://www.postgresql.org/docs/12/server-start.html for further
150+
# justification of this as the default value, namely that the example (and
151+
# shipped) systemd service files use the "Fast Shutdown mode" for service
152+
# termination.
153+
#
154+
STOPSIGNAL SIGINT
155+
#
156+
# An additional setting that is recommended for all users regardless of this
157+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
158+
# equivalent) for controlling how long to wait between sending the defined
159+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
160+
#
161+
# The default in most runtimes (such as Docker) is 10 seconds, and the
162+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
163+
# that even 90 seconds may not be long enough in many instances.

14/docker-postgres/initdb-extension.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,29 @@ fi
5151

5252
psql -c "select pg_reload_conf();"
5353

54-
# Create the 'template_extension' template db
55-
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD"
54+
# Create the 'template_extension' template DB and application DB
55+
if [ "$APP_DB" != "" ]; then
56+
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD" -v APP_DB="$APP_DB"
57+
else
58+
psql -f /usr/local/bin/pre.sql -v DEPLOY_PASSWORD="$DEPLOY_PASSWORD" -v PGBOUNCER_PASSWORD="$PGBOUNCER_PASSWORD"
59+
fi
5660

5761
# Load extension into template_extension database and $POSTGRES_DB
58-
for DB in "$POSTGRES_DB" template_extension ; do
62+
for DB in "$POSTGRES_DB" template_extension "$APP_DB" ; do
63+
if [ -n "$DB" ]; then
5964
echo "Loading extensions into $DB"
6065

61-
psql --dbname="$DB" -f /usr/local/bin/db_all.sql -v email_server=\"$EMAIL_SERVER\"
66+
psql --dbname="$DB" -f /usr/local/bin/db_all.sql -v email_server="$EMAIL_SERVER"
6267

6368
if [ "$DB" = "postgres" ] ; then
64-
psql --dbname="$DB" -f /usr/local/bin/db_postgres.sql -v email_server=\"$EMAIL_SERVER\"
69+
psql --dbname="$DB" -f /usr/local/bin/db_postgres.sql -v email_server="$EMAIL_SERVER"
6570
else
66-
psql --dbname="$DB" -f /usr/local/bin/db_notpostgres.sql -v IS_SETUPDB=false -v DEV_SCHEMA="$DEV_SCHEMA" -v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -v email_server=\"$EMAIL_SERVER\"
71+
psql --dbname="$DB" -f /usr/local/bin/db_notpostgres.sql -v IS_SETUPDB=false -v DEV_SCHEMA="$DEV_SCHEMA" -v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -v email_server="$EMAIL_SERVER"
72+
if [ "$DB" != "template_extension" ] ; then
73+
psql --dbname="$DB" -f /usr/local/bin/db_target.sql -v DEV_SCHEMA="$DEV_SCHEMA" -v email_server="$EMAIL_SERVER"
74+
fi
6775
fi
76+
fi
6877
done
6978

7079
psql -f /usr/local/bin/post.sql

14/docker-postgres/pre.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ select not exists(select true FROM pg_catalog.pg_database where datname='templat
99
CREATE DATABASE template_extension IS_TEMPLATE true;
1010
\endif
1111

12+
\if :{?APP_DB}
13+
select not exists(select true FROM pg_catalog.pg_database where datname = :'APP_DB') as is_check
14+
\gset
15+
\if :is_check
16+
CREATE DATABASE :"APP_DB";
17+
\endif
18+
\endif
19+
1220
-- create role deploy
1321
-- роль для деплоя, т.е. все объекты в БД должны быть созданы от нее, а не от пользователя postgres (sa)
1422
select not exists(select true FROM pg_catalog.pg_roles where rolname ilike '%deploy%') as is_check

14/docker_start_14.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
docker run --name my_postgres_14 --shm-size 2147483648 -p 5433:5432/tcp \
2+
docker run --rm --name my_postgres_14 --shm-size 2147483648 -p 5433:5432/tcp \
33
-v /var/lib/pgsql/14_1/data:/var/lib/postgresql/data \
44
-v /var/log/postgresql1:/var/log/postgresql \
55
-v /mnt/pgbak2/:/mnt/pgbak \

14/postgres-service.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

14/postgres-service_all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

14/postgres-service_pgb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
ports:
2020
- "5433:5432"
2121
environment:
22+
# APP_DB: "My_db"
2223
# POSTGRES_INITDB_ARGS: "--locale=ru_RU.UTF8 --data-checksums"
2324
POSTGRES_PASSWORD: qweasdzxc
2425
POSTGRES_HOST_AUTH_METHOD: trust

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ _Переменные использующиеся только при перв
213213
| POSTGRES_HOST_AUTH_METHOD | md5 | Эту необязательную переменную можно использовать для управления методом аутентификации для соединений с хостом для всех баз данных, всех пользователей и всех адресов. Это значение используется только на этапе первичной инициализации. |
214214
| PGDATA | /var/lib/postgresql/data | Эту необязательную переменную можно использовать для определения другого местоположения - например, подкаталога - для файлов базы данных. По умолчанию это /var/lib/postgresql/data. Если используемый вами том данных является точкой монтирования файловой системы (например, с постоянными дисками GCE) или удаленной папкой, которая не может быть подключена для пользователя postgres (например, некоторые точки монтирования в NFS), Postgres initdb рекомендует создать подкаталог для хранения данных |
215215
| POSTGRES_INITDB_WALDIR | PGDATA/pg_wal | Эту необязательную переменную среды можно использовать для определения другого места для журнала транзакций Postgres. Иногда может быть желательно хранить журнал транзакций в другом каталоге, который может поддерживаться хранилищем с другими характеристиками производительности или надежности. |
216+
| APP_DB | | Эту необязательную переменную среды можно использовать для определения имени БД которую нужно создать сразу при старте контейнера. БД будет создана только если кластер БД не существует. БД создается также как если вручную создать БД на основе шаблонной БД template_extension и по ней пргонать скрипт update-extension.sh |
216217

217218
Пример показывающий использование подкаталога для каталога данных:
218219

0 commit comments

Comments
 (0)