{"id":18696181,"url":"https://github.com/defstudio/dock-v1","last_synced_at":"2025-04-12T07:30:55.561Z","repository":{"id":36972439,"uuid":"327729782","full_name":"defstudio/dock-v1","owner":"defstudio","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-30T04:58:06.000Z","size":23997,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T09:48:55.262Z","etag":null,"topics":["docker"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-07T21:34:30.000Z","updated_at":"2024-05-03T14:17:39.893Z","dependencies_parsed_at":"2023-02-14T06:31:41.232Z","dependency_job_id":"a6d4240a-86c6-474a-9590-e434ca514ff4","html_url":"https://github.com/defstudio/dock-v1","commit_stats":{"total_commits":501,"total_committers":3,"mean_commits":167.0,"dds":0.3193612774451098,"last_synced_commit":"5cd443a1085d4b1559b155bb3ea426f9b82baa2b"},"previous_names":[],"tags_count":176,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Fdock-v1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Fdock-v1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Fdock-v1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Fdock-v1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defstudio","download_url":"https://codeload.github.com/defstudio/dock-v1/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248533584,"owners_count":21120123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker"],"created_at":"2024-11-07T11:17:27.020Z","updated_at":"2025-04-12T07:30:55.174Z","avatar_url":"https://github.com/defstudio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dock: A simple Docker recipes provider\n\ndefstudio/dock is an autonomous docker development configurator\n\n\n## Usage\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eRequirements\u003c/strong\u003e\u003c/summary\u003e\n   \n   **dock** is a laravel-zero standalone phar file that helps ot build a docker development environment. In order to work properly it needs a working installation of:\n   - php (^7.4)\n   - docker\n   - docker-compose\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eInstallation\u003c/strong\u003e\u003c/summary\u003e\n   \n   **dock** does not require installation, simply download the binary file from\n   [here](https://github.com/def-studio/dock/releases/latest/download/dock) or type this from your project folder:\n   \n   ```bash\n   wget --no-cache https://github.com/def-studio/dock/releases/latest/download/dock\n   ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eBuilding an environment\u003c/strong\u003e\u003c/summary\u003e\n   \n   in order to build a development environment, **dock** uses a \"recipe\" system that configures the proper services for the development target.\n   \n   the first step is .env file initialization:\n   \n   ```bash\n   php dock init\n   ```\n   \n   the system will let you choose a list of recipes:\n   \n   ![recipes-prompt](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/recipes-prompt.jpg)\n   \n   and a configuration wizard will start, if available:\n   \n   ![recipe wizard](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/recipes-wizard.jpg)\n   \n   the process will end up with an `env` file and a `src` folder in your project root:\n   \n   ```\n   Project Root\n   |-- dock\n   |-- .env\n   |-- src/\n   ```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eBuilding and starting docker containers\u003c/strong\u003e\u003c/summary\u003e\n   \n   after an `.env` file is created (manually or by running the `php dock init` command) the development environment can be bring to life:\n   \n   ```bash\n   php dock start --build\n   ```\n   \n   the process can take quite a few minutes, so stop for a coffe (or better, a beer), it will end up with a confirmation in your terminal:\n   \n   ![startup completed](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/recipes-start-done.jpg)\n   \n   your development system is up and running!\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eUpdate \u003cu\u003edock\u003c/u\u003e executable\u003c/strong\u003e\u003c/summary\u003e\n   \n   **dock** embeds a self update command that checks current version against the last released version and auto updates itself:\n   \n   ```bash\n   php dock self-update\n   ```\n   \n   ![command-self-update](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-self-update.jpg)\n\u003c/details\u003e\n\n## Commands\n\n**dock** offers a few commands to mantain and manage the development environment. \n\nNote that additional command can be added by the active recipe, for more information please check each recipe documentation\n\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eShow documentation\u003c/strong\u003e (\u003ccode\u003ephp dock\u003c/code\u003e)\u003c/summary\u003e\n   \n   by typing `php dock` command a list with all available commands will be displayed\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eInit command\u003c/strong\u003e (\u003ccode\u003ephp dock init\u003c/code\u003e)\u003c/summary\u003e\n   \n   the initialization wizard can be started at any time with the `php dock init --force` command\n   \n   note that in order to load the changes the environment should be shut down with the `php dock stop` command\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eLog a service\u003c/strong\u003e (\u003ccode\u003ephp dock log\u003c/code\u003e)\u003c/summary\u003e\n   \n   with the `php dock log` command, a service selection prompt will be displayed and will let the user choose a service for showing its live log:\n   \n   ![log](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-log.jpg)\n   \n   to bypass the prompt, the service name can be given as parameter for the command, es. `php dock log nginx`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eLog all services\u003c/strong\u003e (\u003ccode\u003ephp dock log:all\u003c/code\u003e)\u003c/summary\u003e\n   \n   a condensed log for all services can be displayed with the `php dock log:all` command:\n   \n   ![log all](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-log-all.jpg)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eLog into a service shell\u003c/strong\u003e (\u003ccode\u003ephp dock shell\u003c/code\u003e)\u003c/summary\u003e\n   \n   it is useful, sometimes, to log into a specific container, with the `php dock shell` commands it is possible to select the service to log into:\n   \n   ![shell command](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-shell.jpg)\n   \n   to bypass the prompt, the service name can be given as parameter for the command, ie. `php dock log php`\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eDisplay active containers statistics\u003c/strong\u003e (\u003ccode\u003ephp dock stats\u003c/code\u003e)\u003c/summary\u003e\n   \n   **dock** embeds docker's `stats` command to display containers memory, cpu, i/o data into its own `php dock stats` command\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eList running containers\u003c/strong\u003e (\u003ccode\u003ephp dock list:containers\u003c/code\u003e)\u003c/summary\u003e\n   \n   with the `php dock list:containers` command, **dock** will display the list of all running containers in the system\n   \n   ![list containers](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-list-containers.jpg)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eList available hosts\u003c/strong\u003e (\u003ccode\u003ephp dock list:hosts\u003c/code\u003e)\u003c/summary\u003e\n   \n   usually you will bind your services to a custom hostname, in order to simplify the addressing during development.\n   \n   this means that the OS _hosts_ file should be updated to include the mapping between these hostnames and the local ip address.\n   \n   to obtain a list of the hostnames defined by the build process, type `php dock list:hosts` in your terminal:\n   \n   ![list containers](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-list-hosts.jpg)\n   \n   in this example, you should append this entries to your _hosts_ file\n   \n   ```\n   127.0.0.1         laravel.ktm\n   127.0.0.1         mysql.laravel.ktm\n   127.0.0.1         mail.laravel.ktm\n   ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eList available URLs\u003c/strong\u003e (\u003ccode\u003ephp dock list:urls\u003c/code\u003e)\u003c/summary\u003e\n   \n   like the `list:urls` command, with `php dock list:urls` **dock** can display the list of available urls defined during the build process:\n   \n   ![list containers](https://gitlab.com/defstudio/dock/-/raw/master/docs/images/commands-list-urls.jpg)\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cstrong\u003eStart a Lazydocker instance\u003c/strong\u003e (\u003ccode\u003ephp dock lazydocker\u003c/code\u003e)\u003c/summary\u003e\n   \n   Starts a [Lazydocker](https://github.com/jesseduffield/lazydocker) instance, a simple terminal UI for docker and docker-compose\n\u003c/details\u003e\n\n\n\n## Tips and Tricks\n\n- instead of writing `php dock [command]` you can setup a console alias for dock: `alias dock=\"php dock\"`, so it will be enough to type `dock [command]`\n\n- to make the **dock** alias persistent between reboots, add `alias dock=./dock` at the end of your `~/.bashrc` file\n\n\n## Acknowledgements\n\n- **dock** is built with, and depends on, the awesome [Laravel Zero](https://laravel-zero.com/) by [Nuno Maduro](https://github.com/nunomaduro)\n- **dock** embeds [Jesse Duffield](https://jesseduffield.com/) 's docker management terminal UI: [lazydocker](https://github.com/jesseduffield/lazydocker) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstudio%2Fdock-v1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefstudio%2Fdock-v1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstudio%2Fdock-v1/lists"}