cachethq / cachethq/Docker

Setup with existing postgres

Open
#431 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
439
Forks
271
PR merge metrics
No merged PRs in 30d

Description

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

I did the following:

* git clone https://github.com/cachethq/Docker.git cachet-docker
* cd cachet-docker
* nano docker-compose.yml:
```
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=
- 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.