Skip to content

Commit

Permalink
fix: properly start postgres
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 16, 2024
1 parent d36dd92 commit bf91888
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ PHP_XDEBUG_MODE=develop
# SQL variant to use, possible values: sqlite, mysql, pgsql
SQL=mysql
PRIMARY=local
# other values: "database-postgres"
# other values: "database-pgsql"
EOT
fi

Expand Down
2 changes: 1 addition & 1 deletion data/pgadmin/config/pgpassfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nextcloud.local:5432:database-postgres:postgres:postgres
nextcloud.local:5432:database-pgsql:postgres:postgres
2 changes: 1 addition & 1 deletion data/pgadmin/config/servers.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Group": "Server Group 1",
"Port": 5432,
"Username": "postgres",
"Host": "database-postgres",
"Host": "database-pgsql",
"SSLMode": "prefer",
"MaintenanceDB": "postgres",
"PassFile": "/pgadmin4/config/pgpassfile"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ services:
ports:
- '3306'

database-postgres:
database-pgsql:
image: postgres:latest
environment:
POSTGRES_DB: nextcloud
Expand Down
2 changes: 1 addition & 1 deletion docker/bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ wait_for_other_containers() {
sleep 2
;;
"pgsql")
retry_with_timeout "(echo > /dev/tcp/database-postgres/5432) 2>/dev/null" 30 "⚠ Unable to connect to the PostgreSQL server"
retry_with_timeout "(echo > /dev/tcp/database-pgsql/5432) 2>/dev/null" 30 "⚠ Unable to connect to the PostgreSQL server"
sleep 2
;;
"maxscale")
Expand Down
2 changes: 1 addition & 1 deletion docker/configs/autoconfig_pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$AUTOCONFIG = [
'dbname' => 'nextcloud',
'dbhost' => 'database-postgres',
'dbhost' => 'database-pgsql',
'dbuser' => 'postgres',
'dbpass' => 'postgres',
'dbtype' => 'pgsql'
Expand Down
2 changes: 1 addition & 1 deletion docs/services/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ docker compose exec postgres psql -U nextcloud -d nextcloud

If you prefer a GUI frontend you can additionally launch the pgadmin container with `docker compose up -d pgadmin` and access it via <http://pgadmin.local>.

Alternatively you can use a database client to access the database from the host system. The port can be obtained with `docker compose port database-postgresql 5432`. The host is `localhost` and the credentials are the same as above.
Alternatively you can use a database client to access the database from the host system. The port can be obtained with `docker compose port database-pgsql 5432`. The host is `localhost` and the credentials are the same as above.

After you have started the container open `pgadmin.local` in a web browser. The password for the `nextcloud.local` is `postgres`.
That's it, open the following path to see the Nextcloud tables: `Server group 1 -> nextcloud.local -> Databases -> nextcloud -> Schemas -> public -> Tables`
Expand Down

0 comments on commit bf91888

Please sign in to comment.