diff --git a/backend/.env.example b/backend/.env.example index 6c57527..ef1a877 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -22,10 +22,10 @@ LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=pgsql -DB_HOST=127.0.0.1 +DB_HOST="${PGHOST}" DB_PORT=5432 -DB_DATABASE=backend -DB_USERNAME=root +DB_DATABASE=postgres +DB_USERNAME=postgres DB_PASSWORD= SESSION_DRIVER=database diff --git a/flake.nix b/flake.nix index 945ae9d..2eae39d 100644 --- a/flake.nix +++ b/flake.nix @@ -30,13 +30,11 @@ export PGDATA="$REPO_ROOT/.postgres" export PGHOST="$PGDATA" export PGUSER="postgres" - export PGDATABASE="rabbigerzi" if [ ! -d "$PGDATA" ]; then echo "[pg] initializing cluster at $PGDATA" initdb --auth=trust --username=postgres --no-locale --encoding=UTF8 >/dev/null { - echo "listen_addresses = '127.0.0.1'" echo "unix_socket_directories = '$PGDATA'" } >> "$PGDATA/postgresql.conf" fi diff --git a/process-compose.yml b/process-compose.yml index 4fcfb4e..ec7c7dc 100644 --- a/process-compose.yml +++ b/process-compose.yml @@ -2,12 +2,12 @@ version: "0.5" processes: postgres: - command: postgres -D "$PGDATA" -k "$PGDATA" -c listen_addresses=127.0.0.1 + command: postgres -D "$PGDATA" -k "$PGDATA" -c listen_addresses= shutdown: signal: 2 readiness_probe: exec: - command: pg_isready -h "$PGDATA" + command: pg_isready -h "$PGDATA" -d postgres -U postgres initial_delay_seconds: 1 period_seconds: 2