cachethq / Docker

A Dockerized version of Cachet.
https://cachethq.io
BSD 3-Clause "New" or "Revised" License
415 stars 280 forks source link

Setup issues on Docker #347

Open Fabricio20 opened 5 years ago

Fabricio20 commented 5 years ago

I'm currently trying to set up Cachet, but so far I haven't managed to get it up properly.

Attemp 1 (Via Official Image):

Attempt 2 (Via Official Docker Image - No ENV file):

Attempt 3 (Via Docker-Compose Build)

Any tips on how I can make a persistent docker setup?

bartimaeus commented 5 years ago

@Fabricio20 I'm trying to do the same locally.

Seems like the minimum required environment variables are APP_HOST, APP_KEY and your database credentials. Here is an example of what I did for a minimum config:

  1. Generate a base64 string https://generate.plus/en/base64. Use 33 bytes and check url safe. Will return something like this: Cwts9iSn4QPkFI2Y0KrpIzgTCKIfz-nvv7jteNRT5dO1
  2. Use the following docker-compose.yml config:
version: "3"

services:
  postgres:
    image: postgres:9.5
    volumes:
      - /var/lib/postgresql/data
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    restart: always
  cachet:
    build:
      context: .
      args:
        - cachet_ver=2.4
    ports:
      - 80:8000
    links:
      - postgres:postgres
    environment:
      - APP_DEBUG=false
      - APP_URL=http://localhost
      - APP_KEY=base64:Cwts9iSn4QPkFI2Y0KrpIzgTCKIfz-nvv7jteNRT5dO1
      - DB_DRIVER=pgsql
      - DB_HOST=postgres
      - DB_PORT=5432
      - DB_DATABASE=postgres
      - DB_USERNAME=postgres
      - DB_PASSWORD=postgres
      - DB_PREFIX=chq_
    depends_on:
      - postgres
    restart: on-failure

Everything seems to run; however, I am not able to sign in after setup because of a CSFR error. trying to figure that one out now