Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaizoku cannot connect to the postgres server #157

Open
lasersPew opened this issue Jan 26, 2024 · 1 comment
Open

Kaizoku cannot connect to the postgres server #157

lasersPew opened this issue Jan 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lasersPew
Copy link

Describe the bug

Kaizoku cannot connect to the postgres server, it throws this error:

Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "kaizoku", schema "public" at "db:5432"

Error: P1001: Can't reach database server at `db`:`5432`

Please make sure your database server is running at `db`:`5432`.

Reproduction steps

  1. Use the docker-compose sample at the README.md

Expected behavior

Should work normally.

Additional context

Tried #135 , still no luck. Also, it is in a Docker in WSL instance if that helps.

Docker Compose:

version: '3'
name: kaizoku

volumes:
  db:
  redis:

services:
  app:
    container_name: kaizoku
    image: ghcr.io/oae/kaizoku:latest
    networks:
      weeb:
        ipv4_address: 172.30.0.2
    environment:
      - DATABASE_URL=postgresql://kaizoku:kaizoku@db:5432/kaizoku
      - KAIZOKU_PORT=8000
      - REDIS_HOST=localhost
      - REDIS_PORT=6379
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Singapore
    volumes:
      - /mnt/d/Download/Manga:/data
      - /config/kaizoku:/config
      - /config/kaizoku/logs:/logs
    depends_on:
      db:
        condition: service_healthy
    ports:
      - 8000:8000
  redis:
    image: redis:7-alpine
    volumes:
      - redis:/data
  db:
    image: postgres:15-alpine
    restart: unless-stopped
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U kaizoku']
      interval: 5s
      timeout: 5s
      retries: 5
    environment:
      - POSTGRES_USER=kaizoku
      - POSTGRES_DB=kaizoku
      - POSTGRES_PASSWORD=kaizoku
    volumes:
      - db:/var/lib/postgresql/data
networks:
  weeb:
    external: true
@lasersPew lasersPew added the bug Something isn't working label Jan 26, 2024
@Kyoumuh
Copy link

Kyoumuh commented Feb 9, 2024

Add redis and db to the same network you added app to.
Then change 'db' in the database url to localhost.
DATABASE_URL=postgresql://kaizoku:kaizoku@localhost:5432/kaizoku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants