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 stop
ped, start
ed, or restart
ed. 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 stackstack start
- Start existing services in the stackstack status
- Get the running status of the services in the stack.mongo
,opensearch
, anddashboards
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 stackstack restart
- Restart all stopped or running services in the stackstack 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 containernx stop
- stop the Nuxeo containernx restart
- restart the Nuxeo containernx down
- remove anything created byup
(containers, networks, etc.)nx build
- build the Nuxeo imagenx pullbuild
- build the Nuxeo image; be sure to pull the latest image (useful with wrapper tags like2023
orlatest
)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 changednx logs
- display the Nuxeo container logs via Docker Composenxl
- display Nuxeoserver.log
viatail
(mainly because of https://github.com/nuxeo-sandbox/nuxeo-presales-docker/issues/10)nx rm
- Stops and deletes the Nuxeo containernx new
- Doesrm
followed byup
; use to take configuration changes into accountnxbash
- openbash
in Nuxeo container
nuxeoctl
Aliases for These aliases handle various executing nuxeoctl
commands in the Nuxeo container.
nxctl-stop
- stops Nuxeonxctl-start
- starts Nuxeonxctl-restart
- restarts Nuxeonxctl-mp-list
- lists pluginsnxctl-showconf
- outputs all the configuration parameters and their valuesnxctl-tail
- same asnxl
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}