Skip to content

[DEPLOYMENT] Can't connect to Postgres Database #728

@plang115

Description

@plang115

Describe the bug
Postgres DB can not be reached. I have an external Postgres instance, which is used successfully by lots of other containers on the same machine

To Reproduce
Set up container with external database

Expected behavior
Connect to the external database via environment variables (IP address)

Docker Compose
services:
adventurelog-web:
image: ghcr.io/seanmorley15/adventurelog-frontend:latest
container_name: adventurelog-web
hostname: adventurelog-web
restart: unless-stopped
ports:
- 3000:3000
environment:
- PUBLIC_SERVER_URL=http://adventurelog-server:8000
- ORIGIN=https://gps.srv-app.patrlang.de
- BODY_SIZE_LIMIT=Infinity
- FRONTEND_PORT=3000

adventurelog-server:
image: ghcr.io/seanmorley15/adventurelog-backend:latest
container_name: adventurelog-server
hostname: adventurelog-server
restart: unless-stopped
ports:
- 8016:8016
volumes:
- /opt/docker/Backup/adventurelog:/code/media/
environment:
- SECRET_KEY=secret
- DJANGO_ADMIN_USERNAME=secret
- DJANGO_ADMIN_PASSWORD=secret
- DJANGO_ADMIN_EMAIL=secret
- PUBLIC_URL=http://localhost:8016
- CSRF_TRUSTED_ORIGINS=http://localhost:8016,http://adventurelog-web:8015,https://my.reverse.proxy.address
- DEBUG=True
- FRONTEND_URL=https://my.reverse.proxy.address:443
- BACKEND_PORT=8016
- PGHOST=10.1.1.13
- PGPORT=5432
- PGDATABASE=my_secret_database_name
- PGUSER=my_secret_user_in_postgres
- PGPASSWORD=my_secret_user_pass_in_postgres
- DISABLE_REGISTRATION=False

Additional context
There are unfortunately no environment variables described for the backend (server) to connect to a Postgre SQL instance in the official description. The container log of the backend only says: "PostgreSQL is unavailable - sleeping"

Metadata

Metadata

Assignees

No one assigned

    Labels

    deploymentIssues related to deploying AdventureLog

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions