Commands - nuxeo-sandbox/nuxeo-presales-docker GitHub Wiki

Introduction

There are several types of commands that can be used with this Docker-based Nuxeo stack, as defined in the Makefile. Aliases have been created to make management of the services as easy as possible. The aliases are defined in aliases.sh.

Stack Lifecycle

The Docker Compose stack has a lifecycle to manage the associated services. Generically, the lifecycle follows the pattern:

build โ†’ up โ†’ (stop, start, restart) โ†’ down

Once the stack is built, it can be brought to an up state, where all services are running. Once the stack is up, it can be stopped, started, or restarted. If you want to remove your services, you can use the down command. Additional commands, such as logs can be used to view the service logs.

The stack is configured so that all services will be restarted unless they were explicitly stopped.

Command Aliases

The repository contains a set of convenient aliases that you can use to manage the stack. We suggest adding the aliases defined in aliases.sh to your local shell login script. Caution: please be aware that these aliases may override or conflict with existing programs on your machine (such as mongo).

Stack Alias

The "stack" contains containers for Nuxeo Server, OpenSearch, MongoDB, and OpenSearch Dashboards. The services are named nuxeo, opensearch, mongo, and dashboards.

NB: the stack alias generally affects all services at once. E.g. stack stop stops all services. Most of the time we only want to mess with the nuxeo service, so you can use the nx alias instead (see below).

  • stack up - Build/create and start everything in the stack
  • stack start - Start existing services in the stack
  • stack status - Get the running status of the services in the stack. mongo, opensearch, and dashboards should all report โ€œhealthyโ€
  • stack logs - Tail on all of the service logs. If you need a specific service, use one of the other service commands listed below.
  • stack stop - Stop all running services in the stack
  • stack restart - Restart all stopped or running services in the stack
  • stack down - Remove all running or stopped containers - intermediate containers will be removed Use with Caution
  • CAUTION! stack clean - Remove all containers, all volumes, and all configuration

Example

This is an example of how to start a shell for a specific service - you must provide only one of nuxeo, mongo, opensearch, dashboards for the SERVICE argument. The COMMAND should be bash or whatever shell you want to run.

stack exec SERVICE={nuxeo|mongo|opensearch|dashboards} COMMAND=bash

Individual Service Commands

In addition to the stack alias documented above, there are also service-specific aliases that act on a single container. Most of the targets (up, down, build, etc.) are the same. Additional commands are also available to retrieve Nuxeo logs, edit the environment / configuration, as well as open a bash shell.

Nuxeo Service

The Nuxeo container service alias is nx and can be used to manage the container state.

  • nx start - start the Nuxeo container
  • nx stop - stop the Nuxeo container
  • nx restart - restart the Nuxeo container
  • nx down - remove anything created by up (containers, networks, etc.)
  • nx build - build the Nuxeo image
  • nx pullbuild - build the Nuxeo image; be sure to pull the latest image (useful with wrapper tags like 2023 or latest)
  • nx rebuild - pull and build the Nuxeo image with no cache; useful when install Studio SNAPSHOTs since Docker can't know if the Studio project is changed
  • nx logs - display the Nuxeo container logs via Docker Compose
  • nxl - display Nuxeo server.log via tail (mainly because of https://github.com/nuxeo-sandbox/nuxeo-presales-docker/issues/10)
  • nx rm - Stops and deletes the Nuxeo container
  • nx new - Does rm followed by up; use to take configuration changes into account
  • nxbash - open bash in Nuxeo container

Aliases for nuxeoctl

These aliases handle various executing nuxeoctl commands in the Nuxeo container.

  • nxctl-stop - stops Nuxeo
  • nxctl-start - starts Nuxeo
  • nxctl-restart - restarts Nuxeo
  • nxctl-mp-list - lists plugins
  • nxctl-showconf - outputs all the configuration parameters and their values
  • nxctl-tail - same as nxl

Mongo Alias

The MongoDB container service alias is mongodb and can be used to manage the container state. The alias for the mongo client is simply mongo. This alias will start a client shell from within the mongo container.

Start the mongo client: mongo

Lifecycle commands: mongodb {start|stop|restart|down|rm|logs|pull}


Next: Frequently Asked Questions