Skip to content

Postgresql database error #464

@KozecM

Description

@KozecM

I'm currently trying to install this onto my linux server and I seem to ben encountering an error with postgres when trying to run it. I have made sure that postgres is up to date (version 18) but I still seem to be having this problem.
This is my YAML file:

version: '3'

services:
  postgres:
    container_name: photonix-postgres
    image: postgres:18-alpine
    environment:
      POSTGRES_DB: photonix
      POSTGRES_PASSWORD: password
    volumes:
      - ./data/db:/var/lib/postgresql/data

  redis:
    container_name: photonix-redis
    image: redis:8-alpine

  photonix:
    container_name: photonix
    image: photonixapp/photonix:latest
    ports:
      - '8888:80'
    environment:
      ENV: prd
      POSTGRES_HOST: postgres
      POSTGRES_DB: photonix
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
      REDIS_HOST: redis
      ALLOWED_HOSTS: '*'
      # More configuration options here: https://photonix.org/docs/configuration/
    volumes:
      - ./data/photos:/data/photos
      - ./data/raw-photos-processed:/data/raw-photos-processed
      - ./data/cache:/data/cache
      - ./data/models:/data/models
    links:
      - postgres
      - redis

And this is my error:

~/photonix$ sudo docker-compose up
Starting 81c224a25c55_photonix-postgres ...
Starting 81c224a25c55_photonix-postgres ... done
Starting photonix                       ... done
Attaching to photonix-redis, 81c224a25c55_photonix-postgres, photonix
81c224a25c55_photonix-postgres | Error: in 18+, these Docker images are configured to store database data in a
81c224a25c55_photonix-postgres |        format which is compatible with "pg_ctlcluster" (specifically, using
81c224a25c55_photonix-postgres |        major-version-specific directory names).  This better reflects how
81c224a25c55_photonix-postgres |        PostgreSQL itself works, and how upgrades are to be performed.
81c224a25c55_photonix-postgres |
81c224a25c55_photonix-postgres |        See also https://github.com/docker-library/postgres/pull/1259
81c224a25c55_photonix-postgres |
81c224a25c55_photonix-postgres |        Counter to that, there appears to be PostgreSQL data in:
81c224a25c55_photonix-postgres |          /var/lib/postgresql/data (unused mount/volume)
81c224a25c55_photonix-postgres |
81c224a25c55_photonix-postgres |        This is usually the result of upgrading the Docker image without
81c224a25c55_photonix-postgres |        upgrading the underlying database using "pg_upgrade" (which requires both
81c224a25c55_photonix-postgres |        versions).
81c224a25c55_photonix-postgres |
81c224a25c55_photonix-postgres |        The suggested container configuration for 18+ is to place a single mount
81c224a25c55_photonix-postgres |        at /var/lib/postgresql which will then place PostgreSQL data in a
81c224a25c55_photonix-postgres |        subdirectory, allowing usage of "pg_upgrade --link" without mount point
81c224a25c55_photonix-postgres |        boundary issues.
81c224a25c55_photonix-postgres |
81c224a25c55_photonix-postgres |        See https://github.com/docker-library/postgres/issues/37 for a (long)
81c224a25c55_photonix-postgres |        discussion around this process, and suggestions for how to do so.
photonix    | postgres: forward host lookup failed: Host name lookup failure : Resource temporarily unavailable
photonix    | Postgres is unavailable - sleeping
81c224a25c55_photonix-postgres exited with code 1

is there a command I should be running with docker-compose up in order to make sure that the postgresql db is upgraded correctly?
Thanks for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions