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

Setup with existing postgres #431

Open
lb-ovc opened this issue Oct 13, 2024 · 1 comment
Open

Setup with existing postgres #431

lb-ovc opened this issue Oct 13, 2024 · 1 comment

Comments

@lb-ovc
Copy link

lb-ovc commented Oct 13, 2024

Hello, i am trying to set up cachet with an existing postgres installation.

I did the following:

version: "3"

services:
  # postgres:
  #   image: postgres:12-alpine
  #   volumes:
  #     - /var/lib/postgresql/data
  #   environment:
  #     - POSTGRES_USER=postgres
  #     - POSTGRES_PASSWORD=0q7QwkcLR7hhxvRYsz1ETaDhiD9hFZeEfPAeN71xSoKk34tdxx
  #     - POSTGRES_DATABASE=cachet
  #   restart: always
  cachet:
    build:
      context: .
      args:
        - cachet_ver=2.4
    ports:
      - 81:8000 
    # links:
    #   - postgres:postgres
    environment:
      - DB_DRIVER=pgsql
      - DB_HOST=/var/run/postgresql
      - DB_PORT=5432
      - DB_DATABASE=cachet  #created that db
      - DB_USERNAME=postgres
      - DB_PASSWORD=<postgres-user-password>
      - DB_PREFIX=chq_
      - APP_KEY=${APP_KEY:-null}
      - APP_LOG=errorlog
      - APP_ENV=${APP_ENV:-production}
      - APP_DEBUG=false
      - DEBUG=false
    restart: on-failure

I needed to change to another port as 80 is already exposed for a different service of us

  • docker compose build
  • docker compose up
[+] Running 1/0
 ✔ Container cachet-docker-cachet-1  Created                                                                                                                                                                                                                                                  0.0s 
Attaching to cachet-1
cachet-1  | Initializing Cachet container ...
cachet-1  | ERROR: Please set the 'APP_KEY=base64:xxx' environment variable at runtime or in docker-compose.yml and re-launch
cachet-1 exited with code 0
  • set the APP_KEY
  • docker compose build & docker compose up:
 ✔ Container cachet-docker-cachet-1  Recreated                                                                                                                                                                                                                                                0.1s 
Attaching to cachet-1
cachet-1  | Initializing Cachet container ...
cachet-1  | Attempting to connect to database ...
cachet-1  | ...........................................................
cachet-1  | Could not connect to database server! Aborting...
cachet-1 exited with code 0
@lb-ovc
Copy link
Author

lb-ovc commented Oct 13, 2024

Found the Issue.. needed to set the ip of the server as the postgres host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant