https://github.com/dugajean/dockr-cli
Easy docker-compose local development setup for your LAMP and LEMP projects.
https://github.com/dugajean/dockr-cli
docker docker-compose
Last synced: 5 months ago
JSON representation
Easy docker-compose local development setup for your LAMP and LEMP projects.
- Host: GitHub
- URL: https://github.com/dugajean/dockr-cli
- Owner: dugajean
- License: mit
- Archived: true
- Created: 2019-02-02T19:46:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-02T15:18:01.000Z (over 6 years ago)
- Last Synced: 2025-04-14T10:42:59.569Z (about 1 year ago)
- Topics: docker, docker-compose
- Language: PHP
- Homepage:
- Size: 163 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Dockr CLI
[](https://travis-ci.org/dugajean/dockr-cli)
[](https://packagist.org/packages/dugajean/dockr-cli)
[](https://packagist.org/packages/dugajean/dockr-cli)
[](https://packagist.org/packages/dugajean/dockr-cli)
Easy docker-compose local development setup for your LAMP and LEMP projects.
## Requirements
- Docker & docker-compose
- PHP 7.1+
- `ext-json`
- `ext-ctype`
## Download
###### For direct use
To download the latest release, head over to [Releases](https://github.com/dugajean/dockr-cli/releases) and pick the latest PHAR. Then:
```bash
$ dockr.phar --version
```
Feel free to move this to `/usr/local/bin` so you can run it from anywhere: `$ mv ./dockr.phar /usr/local/bin/dockr`
###### Per project installation
```bash
$ composer require dugajean/dockr-cli --dev
```
```bash
$ vendor/bin/dockr --version
```
## Usage
Run the following command to initialize dockr:
```bash
$ dockr init
```
Open the newly created file `dockr.json` and read through it. Make sure everything is what you expect it to be. Then refer to the `aliases` section of the file. There you will see a couple of aliases preset for you: One will turn on the Docker containers and the other will shut them off.
Use as follows: `$ dockr up` and `$ dockr down` respectively.
You can also set your own aliases there to control your setup. You can set aliases for SSH-ing into a container, delete the docker images or whatever you want. You can also point to a class which extends Symfony's `Command` class by providing the fully qualified namespace.
Examples:
```
// ...
"aliases": {
// ...
"ssh": {
"help": "SSH into a container.",
"commands": [
"docker-compose -f .docker/docker-compose.yml exec {container} bash"
]
},
"mycmd": [
"\\Fully\\Qualified\\Namespace\\To\\MyCommand"
]
}
```
Execute the commands like so: `$ dockr ssh php-fpm` and `$ dockr mycmd`. As you can see, you can provide arguments to your custom commands.
For a full list of available commands, run `$ dockr` and if you need help with a specific command run:
```bash
$ dockr help
```
## Testing
```bash
$ vendor/bin/phpunit
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## License
Pouch is released under [the MIT License](LICENSE).