Download the PHP package reach-digital/docker-devbox without Composer

On this page you can find all versions of the php package reach-digital/docker-devbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package docker-devbox

🐳 Reach Digital Magento 2.4 Docker+local hybrid development environment. 🐳

Docker for services, PHP locally. No sync, no mental overhead, no performance penalties.

Services included: php, nginx, https, http/2, varnish, mysql, elasticsearch, rabbitmq, mailcrab.

PHP runs outside of Docker for optimal performance and being able to just run your tooling (i.e. bin/magento) from your local terminal.

Due to Docker VMM's improved performance, we use bind mounts to share files for the services that need it (nginx). We use guest-only volumes for services that don't need to share data for optimal performance (mysql, elasticsearch, etc.)

Goals

Principles

Requirements

Global installation (only once)

Cleanup your system

Since we're running some things locally it probably is a good time to clean some stuff up.

You should not have any services running like.

Take a look at ~/.bash_profile or ~/.zshrc and make sure it doesn't contain any references to $BREW_PREFIX/Cellar/php*.

Installing PHP and php-fpm services

Since we're running a hybrid docker+local system we need to set up PHP to run locally. An install.sh script is provided for this, which you can run locally after cloning this repository.

For running the script directly, use:

It will (re)install multiple php-fpm services, one for each version (port: 9072, 9073, 9074, etc.) and one for each version with xdebug (port: 9172, 9173, 9174, etc.).

Switching between PHP versions

You can switch between CLI PHP versions using brew link. For example to switch to 8.2:

Should now show the right version (check with php -v). If it doesn't there might be still be a version linked, or your ~/.bash_profile should be cleaned up, or you need to reopen your CLI.

For easy switching between versions you can set up aliases like so:

Install docker

  1. Install latest version of docker for mac.
  2. Start Docker
  3. Exclude ~/Library/Containers from your backups
  4. brew install ctop: can be used to show container metrics.
  5. Open Docker -> Settings -> Resources, set memory to 6-8 GB
  6. Open Docker -> Settings -> General, set virtual machine manager to Docker VMM

Install local certificate

You are now done with the global installation 🎉

Project installation

This covers initially adding docker-devbox support to a Magento project; if your project already has docker-devbox support added, please refer to the projects' own README.

Usage

You now have all services set up 🎉. See individual services below to set urls, caches, etc.

Deleting data (mysql/elasticsearch):

To delete the data for (for example) MySQL, stop your containers and remove the associated docker volume:

You can use docker-compose volumes to see the volumes associated with your project.

Be sure to give MySQL a minute or two to re-initialize the data directory - during this time it will not accept connections.

Usage and setup

Configuring Magento

Configuration for all the services is included in the example env.php

How do I use xdebug?

How do I set up my cron?

default setup

Where can I find logs?

How do I set up urls/https?

https only with hitch. The docker container does not support http, only https.

How do I set up multiple websites?

To allow our nginx setup to work with multiple websites we need change the nginx environment parameter MAGE_RUN_TYPE from store to website

To define our website or storeview codes we have to add a new configuration file, for example nginx-map.conf, to map$MAGE_RUN_CODE to the relevant website_code or storeview_code.

Add the file path to the nginx volumes, for example:

Your website or storeview should now be available.

For more information check the magento docs: https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/multi-sites/ms-nginx.html

Managing Varnish

Managing Redis

To flush Redis directly when bin/magento is broken, run docker-compose exec redis redis-cli flushall.

Using Mailcrab

The Mailcrab webinterface is available at http://localhost:8025/.

As of Magento 2.4.6, a third party SMTP delivery module is no longer required.

For Magento versions older than 2.4.6, see https://github.com/ho-nl/docker-development-box/tree/741d193a68200c976cd13987a986d7063a984b1d?tab=readme-ov-file#how-do-i-set-up-mailhog

Using ngrok

Uncomment the ngrok service in your docker-compose.yml to use Ngrok. This exposes your local environment to the public internet over secure tunnels.

You will need to register an account at https://ngrok.com/ and configure a token to make use of this service:

Connecting to contains through SSH

  1. Open up ctop
  2. on your service
  3. exec shell

Please note that the containers are as minimal as possible, so not all common tools are available, but you should be able to get around.

Customizing dockerized services

Everything is set up via the docker-compose.yml file. You see paths to the configuration files used, various environment variables, and commandline options there and can change these as needed for your project.

  1. Change the path to your custom configuration file.
  2. Run docker-compose down && docker-compose up -d
  3. Changes should be applied, check ctop if your container is able to start.

Restarting the php-fpm service

These run as macOS services (for each PHP version and with/without xdebug) on the host, and can all be restarted with: pkill php-fpm

Commits

Commits are validated with https://github.com/conventional-changelog/commitlint

Gittower: Gittower doesn't properly read your PATH variable and thus commit validation doesn't work. Use gittower . to open this repo.

Troubleshooting

The Compose file './docker-compose.yml' is invalid

ERROR: The Compose file './docker-compose.yml' is invalid because: Unsupported config option for services.mailhog: 'platform'

Please update Docker to fix this error. This error happens because your Docker version is too low and does not support the platform option. This option is used in recent versions of docker-development-devbox to enable support for both Intel and Apple Silicon macbooks.

docker-composer and/or ctop are not able to connect to the Docker daemon

ERROR: Couldn't connect to Docker daemon. You might need to start Docker for Mac.

This may happen if you've upgraded from an old version of Docker. In more recent versions of docker, the socket file through which one can connect with the deamon was moved to ~/.docker/run/docker.sock. Programs like ctop and docker-composer use the symlink at /var/run/docker.sock which may still point to the old path.

To correct this, run the following:


All versions of docker-devbox with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package reach-digital/docker-devbox contains the following files

Loading the files please wait ....