ems-project / elasticms-demo

[READONLY] A default elasticms local setup using docker-compose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elasticms-demo

A demo elasticms local setup with docker compose.

Resources

TL;DR

export DOCKER_USER=$UID
sh npm.sh install
sh npm.sh run prod
docker compose pull
docker compose up -d

Please wait a minute

sh ems.sh create_users local
sh ems.sh config_push local

Go here and login with the demo username and the password you just defined.

An admin debug url is also available.

Prerequisites

You need docker compose (or an alternative as Podman) on a running Linux system (or WSL if you are under Windows). It should also work with Docker Desktop, tell us if you face issues with it.

It's recommended to allow at least 6GB of memory to docker.

The following ports must be available:

  • 8888: Traefik UI
  • 80: Web HTTP
  • 443: Web HTTPS

If you need (recommanded) to use a specific UID, please set the DOCKER_USER environment variable:

export DOCKER_USER=$UID

You may consider to add it permanently to your .profile:

cat >> ~/.profile <<EOP
export DOCKER_USER=$UID
EOP

Install steps

Open a terminal and run the following commands:

  • export DOCKER_USER=$UID: Set the user id
  • sh npm.sh install: install NPM dependencies
  • sh npm.sh run prod: Build the frontend assets (js, css, ...)
  • docker compose pull: Ensure to get the last images
  • docker compose up -d: Start the docker container (in daemon mode)

ELK stack version

If you want to use elasticsearch 8 instead of elasticsearch 7, define this variable first:

export ELK_VERSION=elk8

Available stacks:

  • elk7: elasticsearch 7.17.7
  • elk8: elasticsearch 8.5.3
  • os2: OpenSearch 2.4.1

Before continuing, check that all services have been correctly started by running docker compose ps. All services must be in running status or in running (healthy) status. Except for the setup_elk and the setup_minio which should be in exited (0) status.

Go to minio and login with those credentials:

  • user: accesskey
  • password: secretkey

Verify that a demo bucket has been created, otherwise create it.

Go back to your console:

  • sh ems.sh create_users local
    • A demo admin user is created with the email and the password that you provide
    • You have now access to an empty elasticms-admin
  • sh ems.sh config_push local will setup elasticms's configuration, content types, documents & so forth.
    • The script will ask for the demo's password you just defined

It's all set: elasticms-admin

Check the web preview and the web live

You can now login with your just defined password and the username demo in elasticms.

User

Some default user are created by the create_users command:

  • author: can edit web documents
  • publisher: can edit and publish web documents in live
  • webmaster: can edit and publish all kind of documents

Commands

List the available commands with this command: sh ems.sh --help

In this demo project only one local environment have been defined.

Usage: ems.sh <command> [options]

Commands:
    admin:        call the admin CLI for the given environment (corresponding to the admin-{environment} docker compose service)
    web:          call the web CLI for the given environment (corresponding to the web-{environment} docker compose service)
    create_users: create demo users in the given environment (corresponding to the admin-{environment} docker compose service)
    config_push:  load admin's configuration in the given environment (corresponding to the web-{environment} docker compose service)

There also a separated npm.sh script:

  • npm: Run a npm console (in a docker run container)

Troubleshooting

FAQ

  • The labels are not translated in the skeleton: clear the cache for the corresponding skeleton i.e. sh ems.sh web local c:c
  • I do not see form submissions in the elasticms mini-CRM: Generate a .env.local and this EMSF_AUTHKEY=AUTH_KEY with a authkey that you can generate in the user datatable view and restart docker: docker compose up --force-recreate
  • In some cases, updates in the webpack/npm application (/src) are not taken into account with the npm run watch command: docker compose doesn't allow npm to be notified on file changes. You should, or use the npm run dev command eachtime that you need. Or use a local installation of npm.

Useful commands

  • docker compose ps : List containers
  • docker compose logs -f : View output from containers

Useful links

  • Traefik : An HTTP reverse proxy
  • mailhog : A Mail catcher
  • kibana : A dev tools to query elasticsearch
  • elasticsearch : The search engine, Verify that the status is green
  • minio : A S3 like storage service
  • elasticms admin : elasticms
  • Test the website:
    • preview : skeleton with preview's contents
    • live : skeleton with live's contents
  • Debug issue with varnish:
    • preview nocache : skeleton with preview's contents without cache (varnish is bypassed)
    • live nocache : skeleton with live's contents without cache (varnish is bypassed)

About

[READONLY] A default elasticms local setup using docker-compose

License:MIT License


Languages

Language:Twig 69.1%Language:JavaScript 16.5%Language:SCSS 7.9%Language:Makefile 4.3%Language:XSLT 2.3%