Download the PHP package percymamedy/dcompose without Composer
On this page you can find all versions of the php package percymamedy/dcompose. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download percymamedy/dcompose
More information about percymamedy/dcompose
Files in percymamedy/dcompose
Informations about the package dcompose
Dcompose
Introduction
Laradock is an awesome tool that helps with building a Docker environment for running your Laravel or PHP apps.
However, it can be quite a pain to identify and use only specific components needed for your app. Most of the time
you'll find yourself using only few images and remembering which one (So you can run docker-compose up -d
I built Dcompose because I was always finding myself copying the images' Docker files needed from laradock to my projects and recreating the docker-compose.yml file everytime for each project. Inspired by Composer, I embarked on a quest to build my own tool that would "require" in my projects only the components that I needed and update automatically my docker-compose.yml file.
This is how Dcompose was born. I do not know where this library will end up but my hope is for people who've had the same issue as me might find it useful.
License
Dcompose is open-sourced software licensed under the MIT license
Installation
Fisrt make sur you have Docker and Docker Compose installed on your system. Check out Docker and Docker Compose installation docs.
Then, download Dcompose using Composer:
Make sure to place composer's system-wide vendor bin directory in your $PATH so the Dcompose executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:
- macOS: $HOME/.composer/vendor/bin
- GNU / Linux Distributions: $HOME/.config/composer/vendor/bin
Usage
Init command
With the init command you may start defining which services you want to use in your project. You should run this command in the root of your project like follows:
This is an interacting command which will ask you about your project name and services which you'll use. Services are just the Laradock services which exists, check out laradock's github repo to get a sense of all services which you can require.
After running this command a new folder will be created into your project's root directory which will contain only the services and correct file layout.
You will also find a file inside the .docker folder. You can modify this file to change values specific for your environment.
Now you may run the following command inside the folder to run your project :
Require command
If you've missed a service or you need another service from laradock you can run the require command as follows:
Where is the name of one of laradock's services. This will then add the service to your folder and file.
Now you may run the following command inside the folder :
or :
If you've ran the command.
Remove command
You can remove a service using the following command :
This is not going to remove the service folder from the folder and correct sections from file.
However the container, image and volume created for this service will still be on your system. To remove them completely you should run docker commands :
Generate tools command
Generating the commands line tools helps in running and executing docker containers from laradock :
A new script will be created which gives you access to three options:
Start docker containers:
Stop docker containers:
Ssh into workspace container after starting contaners :
Refresh command
laradock files are fetched and cached such that , and command are carried out faster without the need to refetch files from dist all the time.
However, there is not way of knowing when laradock has been updated, thus the command allows us to refresh the cached laradock files :
Road map v0.2
- [ ] Make code more consistent with an object oriented approach.
- [ ] Use something like doctrine cache for managing laradock file hence eliminating the need for refresh command by having expiration.
Road map v0.3
- [ ] Add a manifest file in JSON or YML that will contain all docker containers hence eliminating the need for commiting the .docker folder.
Credits
Big Thanks to all developers who worked hard to create something amazing!
Creator
Twitter: @PercyMamedy
GitHub: percymamedy
All versions of dcompose with dependencies
ext-zip Version *
guzzlehttp/guzzle Version ~6.0
laravel-zero/framework Version ^7.0
symfony/finder Version ^5.0
symfony/yaml Version ^5.0
laminas/laminas-text Version ^2.7