diff --git a/backend/.env.example b/backend/.env.example index ef1a877..6c57527 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="${PGHOST}" +DB_HOST=127.0.0.1 DB_PORT=5432 -DB_DATABASE=postgres -DB_USERNAME=postgres +DB_DATABASE=backend +DB_USERNAME=root DB_PASSWORD= SESSION_DRIVER=database diff --git a/flake.nix b/flake.nix index 2eae39d..945ae9d 100644 --- a/flake.nix +++ b/flake.nix @@ -30,11 +30,13 @@ 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 ec7c7dc..4fcfb4e 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= + command: postgres -D "$PGDATA" -k "$PGDATA" -c listen_addresses=127.0.0.1 shutdown: signal: 2 readiness_probe: exec: - command: pg_isready -h "$PGDATA" -d postgres -U postgres + command: pg_isready -h "$PGDATA" initial_delay_seconds: 1 period_seconds: 2