Skip to content

Commit 6483db8

Browse files
committed
fix: address pr #2054 review comments.
1 parent 309f8bd commit 6483db8

4 files changed

Lines changed: 16 additions & 57 deletions

File tree

Dockerfile-multigres

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# docker build -f Dockerfile-multigres --target variant-orioledb-17 -t multigres-orioledb-17 .
77

88
####################
9-
# Stage 1a: Nix builderPostgreSQL 17
9+
# Stage 0: Nix baseshared Alpine + Nix setup for all builders
1010
####################
11-
FROM alpine:3.21 AS nix-builder-17
11+
FROM alpine:3.21 AS nix-base
1212

1313
RUN apk add --no-cache \
1414
bash \
@@ -35,6 +35,11 @@ ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
3535
WORKDIR /nixpg
3636
COPY . .
3737

38+
####################
39+
# Stage 1a: Nix builder — PostgreSQL 17
40+
####################
41+
FROM nix-base AS nix-builder-17
42+
3843
RUN nix profile add path:.#psql_17_slim/bin path:.#pg-backrest path:.#pgctld
3944

4045
RUN nix store gc
@@ -48,32 +53,7 @@ RUN nix store gc
4853
####################
4954
# Stage 1b: Nix builder — OrioleDB 17
5055
####################
51-
FROM alpine:3.21 AS nix-builder-orioledb-17
52-
53-
RUN apk add --no-cache \
54-
bash \
55-
coreutils \
56-
curl \
57-
shadow \
58-
sudo \
59-
xz
60-
61-
RUN addgroup -S postgres && \
62-
adduser -S -h /var/lib/postgresql -s /bin/bash -G postgres postgres && \
63-
addgroup -S wal-g && \
64-
adduser -S -s /bin/bash -G wal-g wal-g
65-
66-
RUN cat <<EOF > /tmp/extra-nix.conf
67-
extra-experimental-features = nix-command flakes
68-
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
69-
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
70-
EOF
71-
RUN curl -L https://releases.nixos.org/nix/nix-2.33.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
72-
73-
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
74-
75-
WORKDIR /nixpg
76-
COPY . .
56+
FROM nix-base AS nix-builder-orioledb-17
7757

7858
RUN nix profile add path:.#psql_orioledb-17_slim/bin path:.#pg-backrest path:.#pgctld
7959

docker/pgctld/orioledb-postgresql.conf.tmpl

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -221,32 +221,14 @@ row_security = on
221221

222222
timezone = 'UTC'
223223

224-
# These settings are initialized by initdb, but they can be changed.
225-
lc_messages = 'en_US.UTF-8' # locale for system error message
226-
# strings
227-
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
228-
lc_numeric = 'en_US.UTF-8' # locale for number formatting
229-
lc_time = 'en_US.UTF-8' # locale for time formatting
230-
231-
# default configuration for text search
232-
default_text_search_config = 'pg_catalog.english'
233-
234-
# These settings are initialized by initdb, but they can be changed.
235-
lc_messages = 'en_US.UTF-8' # locale for system error message
236-
# strings
237-
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
238-
lc_numeric = 'en_US.UTF-8' # locale for number formatting
239-
lc_time = 'en_US.UTF-8' # locale for time formatting
224+
# Locale settings (lc_messages, lc_monetary, lc_numeric, lc_time) are
225+
# inherited from the container environment (LANG, LC_ALL).
240226

241227
# default configuration for text search
242228
default_text_search_config = 'pg_catalog.english'
243229

244230
# - Shared Library Preloading -
245231

246-
## TODO: @rafael - We are starting from a Vanilla postgres. We still
247-
## ened to do work here to make sure we start postgres with libraries that
248-
## will be used by supabase infra.
249-
# shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, supabase_vault' # (change requires restart)
250232
jit_provider = 'llvmjit' # JIT library to use
251233

252234
# - Other Defaults -
@@ -272,7 +254,7 @@ jit_provider = 'llvmjit' # JIT library to use
272254
#------------------------------------------------------------------------------
273255

274256
#exit_on_error = off # terminate session on any error?
275-
#restart_after_crash = on # reinitialize after backend crash?
257+
restart_after_crash = off # reinitialize after backend crash?
276258
#data_sync_retry = off # retry or panic on failure to fsync
277259
# data?
278260
# (change requires restart)
@@ -306,7 +288,7 @@ wal_log_hints = 'on'
306288
# These settings activate OrioleDB as the default table storage engine.
307289
# Injected automatically by the /usr/local/bin/pgctld wrapper in variant-orioledb-17.
308290
#------------------------------------------------------------------------------
309-
shared_preload_libraries = 'orioledb'
291+
shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, auto_explain, pg_tle, plan_filter, supabase_vault, orioledb'
310292
default_table_access_method = 'orioledb'
311293
orioledb.enable_rewind = true
312294
orioledb.rewind_max_time = 1200

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/packages/pgctld.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ buildGoModule {
99
src = multigres-src;
1010
subPackages = [ "go/cmd/pgctld" ];
1111
env.CGO_ENABLED = "0";
12-
ldflags = [
13-
"-s"
14-
"-w"
15-
];
12+
ldflags = [ ];
1613
# The Makefile copies pico CSS assets before go build; pgctld does not use web
1714
# templates so this is a no-op, but kept for safety in case of future imports.
1815
preBuild = ''

0 commit comments

Comments
 (0)