contember / starter-kits

Showcasing some of the things you can achieve with Contember. Customize our starter kits or use them as inspiration.
Apache License 2.0
38 stars 7 forks source link

headless-cms not starting #32

Closed kcouliba closed 2 years ago

kcouliba commented 2 years ago

I'd like to start the application locally, but as I am following the notice, the application start crashes. I have the same behavior using the quickstart.

Thanks for your help.

npm run start

> start
> npm run start-engine && concurrently npm:start-admin npm:start-head

> start-engine
> docker-compose up --detach && npm run contember migrations:execute . --yes

ERROR: The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services: 'contember-cli'
Unsupported config option for volumes: 'pgsql-data'

The Unsupported config option for xxx may vary with subsequent starts

docker version 
Client: Docker Engine - Community
 Version:           20.10.14
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        a224086
 Built:             Thu Mar 24 01:47:57 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.14
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       87a90dc
  Built:            Thu Mar 24 01:45:46 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.11
  GitCommit:        3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc:
  Version:          1.0.3
  GitCommit:        v1.0.3-0-gf46b6ba
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

----------------------------------------------------

docker-compose version
docker-compose version 1.26.0, build d4451659
docker-py version: 4.2.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

----------------------------------------------------

npm -v
8.9.0
kcouliba commented 2 years ago

So, I managed to start the application by editing the docker-compose.yaml file as follows Hope this helps

version: '3.8'

services:
  contember-engine:
    image: contember/engine:1.0.0

    environment:
      NODE_ENV: 'development'

      CONTEMBER_PORT: '4000'
      CONTEMBER_ROOT_EMAIL: 'contember@localhost'
      CONTEMBER_ROOT_PASSWORD: 'contember'
      CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000' # generate token for production by running `openssl rand -hex 20` in console
      CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111' # generate token for production by running `openssl rand -hex 20` in console
      CONTEMBER_ENCRYPTION_KEY: '2222222222222222222222222222222222222222222222222222222222222222' # generate token for production by running `openssl rand -hex 32` in console

      DEFAULT_DB_HOST: 'postgres'
      DEFAULT_DB_PORT: '5432'
      DEFAULT_DB_NAME: 'contember'
      DEFAULT_DB_USER: 'contember'
      DEFAULT_DB_PASSWORD: 'contember'

      DEFAULT_S3_ENDPOINT: 'http://localhost:1483'
      DEFAULT_S3_BUCKET: 'contember'
      DEFAULT_S3_REGION: ''
      DEFAULT_S3_KEY: 'contember'
      DEFAULT_S3_SECRET: 'contember'
      DEFAULT_S3_PROVIDER: 'minio'

      TENANT_MAILER_HOST: 'mailhog'
      TENANT_MAILER_PORT: '1025'
      TENANT_MAILER_FROM: 'contember@localhost'

    ports:
      - '1481:4000'

    healthcheck:
      test: 'curl --fail http://localhost:4000'
      interval: 5s
      timeout: 5s
      retries: 10

    depends_on:
      - postgres

  contember-cli:
    image: contember/cli:1.0.0
    user: '1000:1000'

    deploy:
      replicas: 0

    environment:
      CONTEMBER_API_URL: 'http://contember-engine:4000/'
      CONTEMBER_API_TOKEN: '0000000000000000000000000000000000000000'
      CONTEMBER_PROJECT_NAME: 'headless-cms'

    volumes:
      - ./:/src

    depends_on:
      - contember-engine

  postgres:
    image: postgres:14-alpine

    environment:
      POSTGRES_USER: 'contember'
      POSTGRES_PASSWORD: 'contember'
      POSTGRES_DB: 'contember'

    ports:
      - '1482:5432'

    volumes:
      - pgsql-data:/var/lib/postgresql/data

    healthcheck:
      test: 'pg_isready --username contember'
      interval: 5s
      timeout: 5s
      retries: 10

  minio:
    image: bitnami/minio

    environment:
      MINIO_ROOT_USER: 'contember'
      MINIO_ROOT_PASSWORD: 'contember'
      MINIO_DEFAULT_BUCKETS: 'contember:download'

    ports:
      - '1483:9000'

    volumes:
      - minio-data:/data

  mailhog:
    image: mailhog/mailhog
    ports:
      - '1484:8025'

  adminer:
    image: michalhosna/adminer:4.8.0-en_v1

    environment:
      ADMINER_DRIVER: 'pgsql'
      ADMINER_SERVER: 'postgres'
      ADMINER_DB: 'contember'
      ADMINER_USERNAME: 'contember'
      ADMINER_PASSWORD: 'contember'
      ADMINER_AUTOLOGIN: '1'
      ADMINER_NAME: 'Contember'

    ports:
      - '1485:8080'

    depends_on:
      - postgres

volumes:
  pgsql-data: ~
  minio-data: ~