Docker icon indicating copy to clipboard operation
Docker copied to clipboard

Setup issues on Docker

Open Fabricio20 opened this issue 5 years ago • 1 comments

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):

  • docker.compose.yml
  • Env variables fully defined and also env file MOUNTED.
  • Env file has 777.
  • Using v2.3.15 of official image tags. Result: Cachet starts up but errors out as soon as it starts up (due to file move attempt).
Initializing Cachet container ...
sed: can't move '/var/www/html/.envkCLLJI' to '/var/www/html/.env': Resource busy

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

  • docker.compose.yml
  • Env variables fully defined on compose.
  • Using v2.3.15 of official image tags. Result: Cachet starts up and goes to setup page, after successful setup, if I kill the container and start again, we are back to setup.

Attempt 3 (Via Docker-Compose Build)

  • docker-compose.yml downloaded from this repo. Result: Build fails with out of memory on PHP Composer build (even if build container was started with >2GB memory).

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

Fabricio20 avatar Jul 03 '19 00:07 Fabricio20

@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

bartimaeus avatar Jul 29 '19 20:07 bartimaeus