Sign inSign up

aeonis/capsule-cli

By aeonis

•Updated 9 months ago

Image
0

3.3K

aeonis/capsule-cli repository overview

⁠CLI Docker image for Capsule

This image is focused on console tools necessary to develop LAMP stack (and other web) applications.

⁠Features

  • php/php-fpm (w/ xdebug), nodejs (via nvm)
  • Framework specific tools for Wordpress
  • Miscellaneous cli tools for day to day web development
  • Hosting provider cli tools (Platform.sh)
  • Cron job scheduling
  • Custom startup script support

⁠Versions and image tag naming convention

  • aeonis/capsule-cli:7.2
  • aeonis/capsule-cli:7.3
  • aeonis/capsule-cli:7.4

⁠PHP

  • php-fpm && php-cli
  • xdebug
  • composer
  • wp-cli (Wordpress)

This image uses the official php-fpm images from Docker Hub⁠ as the base.
This means that PHP and all modules are installed from source. Extra modules have to be installed in the same manner (installing them with apt-get won't work).

⁠Available PHP database drivers
  • SQLite - via sqlite3, pdo_sqlite
  • MySQL - via mysqli, mysqlnd, pdo_mysql
  • PostgreSQL - via pgsql, pdo_pgsql
  • MSSQL - via sqlsrv and pdo_sqlsrv
⁠Using PHP Xdebug

Xdebug is disabled by default.

To enable it, run the image with XDEBUG_ENABLED=1:

cli
...
  environment:
    ...
    - XDEBUG_ENABLED=1
    ...

See docs⁠ on using Xdebug for web and cli PHP debugging.

⁠NodeJS

  • nvm
  • node
  • yarn

NodeJS is installed via nvm in the docker user's profile inside the image (/home/docker/.nvm).

This image comes with NodeJS v12.x by default .

If you need a different version of node, use nvm to install it, e.g, nvm install 12.0.0. Then, use nvm use 12.0.0 to use it in the current session or nvm alias default 12.0.0 to use it by default.

⁠Notable console tools

  • git with git-lfs
  • curl, wget
  • zip, unzip
  • mysql, pgsql and mssql cli clients
  • imagemagick, ghostscript
  • mc, rsync
  • mhsendmail
  • cron

⁠Hosting provider tools

Also, see the Secrets⁠ section below for more information on managing and using your hosting provider keys.

⁠Customizing startup

To run a custom startup script anytime the cli container has started, create a startup.sh file within the .capsule/services/cli directory. Additionally, make sure that the file is executable as well so that the container does not run into issues when attempting to execute the file.

⁠Scheduling cron jobs

Cron can be configured by making sure there is a crontab file located within .capsule/services/cli. The file should follow the standard crontab format⁠.

⁠Secrets and integrations

cli can read secrets from environment variables and configure the respective integrations automatically at start.

The recommended place store secrets in Docksal is the global $HOME/.capsule/capsule.env file on the host. From there, secrets are injected into the cli container's environment.

Below is the list of secrets currently supported.

SECRET_SSH_PRIVATE_KEY

Use to pass a private SSH key. The key will be stored in /home/docker/.ssh/id_rsa inside cli and will be considered by the SSH client in addition to the keys loaded in capsule-ssh-agent when establishing a SSH connection from within cli.

This is useful when you need a project stack to inherit a private SSH key that is not shared with other project stacks on the same host (e.g. in shared CI environments).

The value must be base64 encoded, i.e:

cat /path/to/some_key_rsa | base64

SECRET_TERMINUS_TOKEN

Credentials used to authenticate Terminus⁠ with Pantheon. Stored in /home/docker/.terminus/ inside cli.

Terminus is installed and available globally in cli.

SECRET_PLATFORMSH_CLI_TOKEN

Credentials used to authenticate with the Platform.sh CLI⁠ tool. Stored in /home/docker/.platform inside cli.

Platform CLI is installed and available globally in cli.

WEB_KEEPALIVE

Sets the delay in seconds between pings of the web container during execution fin exec. Setting this variable to non zero value prevents the project from stopping in cases of long fin exec and web container inactivity. Disabled by default (set to 0).

⁠Git configuration

When working with git from within the image, it will ask for the user.email and user.name set before you can commit. These can be passed as environment variables and will be applied at the container startup.

GIT_USER_EMAIL="[email protected]"
GIT_USER_NAME="git"

Tag summary

Content type

Image

Digest

sha256:3a2e46f98…

Size

683.9 MB

Last updated

9 months ago

docker pull aeonis/capsule-cli:8.5