I tried creating docker compose nextcloud and the db (postgres), but upon creating a new user, the db is not recognized, even though on the “config/config.php” file the configuration is there. I’m assuming the problem is with the docker’s local IP since I’m using docker’s network to access the site locally (Correct me if I’m wrong)
This is my docker-compose config, (I’m using Portainer)
version: '3'
services:
db:
image: postgres:alpine
hostname: db
restart: always
network_mode: bridge
volumes:
- /var/lib/docker/volumes/nextcloud/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=nextcloud_db
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=admin
redis:
image: redis:alpine
restart: always
network_mode: bridge
app:
image: nextcloud:apache
restart: always
network_mode: bridge
ports:
- 172.17.0.1:8080:80
volumes:
- /var/lib/docker/volumes/nextcloud/nextcloud:/var/www/html
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=nextcloud_db
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=admin
- REDIS_HOST=redis
depends_on:
- db
- redis
I tried opening port for the postgres using
ports:
- 172.17.0.1:5432:5432
And changing POSTGRES_HOST=172.17.0.1:5432
But upon creating admin user, the server instead returned internal error.
Cedric is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.