{"id":26628254,"url":"https://github.com/luanphandinh/env","last_synced_at":"2026-04-17T19:01:36.899Z","repository":{"id":52250316,"uuid":"202295557","full_name":"luanphandinh/env","owner":"luanphandinh","description":"Start working environment with a single script. Including databases, elastic search, nginx, etc","archived":false,"fork":false,"pushed_at":"2021-05-03T14:09:36.000Z","size":209,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T12:36:34.480Z","etag":null,"topics":["docker","docker-compose","workspace"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/luanphandinh.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}},"created_at":"2019-08-14T07:14:16.000Z","updated_at":"2021-05-03T14:09:36.000Z","dependencies_parsed_at":"2022-08-30T19:50:46.070Z","dependency_job_id":null,"html_url":"https://github.com/luanphandinh/env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luanphandinh/env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luanphandinh%2Fenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luanphandinh%2Fenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luanphandinh%2Fenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luanphandinh%2Fenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luanphandinh","download_url":"https://codeload.github.com/luanphandinh/env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luanphandinh%2Fenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31941845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","docker-compose","workspace"],"created_at":"2025-03-24T12:28:36.177Z","updated_at":"2026-04-17T19:01:36.881Z","avatar_url":"https://github.com/luanphandinh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# env ![](https://github.com/luanphandinh/env/workflows/workspace/badge.svg) ![](https://github.com/luanphandinh/env/workflows/cli/badge.svg)\nEasy, clean and faster way to spin up docker containers: mysql, adminer, es, rabbitmq, ...\\\nSeprate profile and highly confirgurable.\n\n## install\nclone this project to anywhwere in your computer, then `cd \u003cpath_to_project\u003e`\n```bash\nmake install\n```\n`cli` is the `alias` refer to `\u003cpath_to_project\u003e/cli.sh` file, if the `make install` command doesn't include the `alias cli -\u003e \u003cpath_to_project\u003e/cli.sh`, you could create alias on your own.\n\n## help\n```bash\ncli -h\ncli docker -h\n```\n\n## docker\nrun:\n```\ncli docker run mysql adminer\n```\nThe command above will look into `./env/etc/docker/` and find `mysql.yaml`, `adminer.yaml` and use `docker-compose` to start docker services.\n\nrun with profile (`cli -p \u003cprofile_name\u003e docker run mysql adminer`):\n```\ncli -p new_to_env docker run mysql adminer\n```\n\nAdd new docker-compose file that not existed in current repository\\\nSimply add `\u003cservice_name\u003e.yml` into `env/etc/docker`.\\\n```\ncli/etc\n  |__docker\n  |     |__ .PORTS          // This file content all the default PORTS that will be used accross all dockers config file\n  |     |__mysql.yaml\n  |     |__adminer.yaml\n  |\n  |__profile\n  |     |__default\n  |     |   |__ .env\n  |     |__ new_to_env\n  |     |   |__ .env\n```\n\nexample file (`etc/docker/mysql.yaml`):\n```yaml\nversion: '3.3'\n\nservices:\n  mysql:\n    container_name: \"${__DOCKER_SERVICE_PREFIX__}_mysql\"\n    hostname: \"${__DOCKER_SERVICE_PREFIX__}_mysql\"\n    image: mysql\n    volumes:\n      - '${__DOCKER_PATH__}/mysql:/var/lib/mysql'\n    command:\n      - --default-authentication-plugin=mysql_native_password\n    environment:\n      MYSQL_ROOT_PASSWORD: rootroot\n      MYSQL_DATABASE: workspace\n      MYSQL_USER: admin\n      MYSQL_PASSWORD: admin\n    ports:\n      - ${MYSQL_PORT}:3306\n```\n\nconfigs:\n* `__DOCKER_PATH__` refer to `var/lib/docker/\u003ccurrent_profile\u003e/`\\\nHighly recommended to use this path, it allows you to seperate your runtime data with profile\n* `__DOCKER_DIR__` refer to current config path `env/etc/docker/`\nIf you want to bind some config that will be reused and not seperate by profile, could be put them into this place\\\nSeem more at `env/etc/docker/vault.yaml`\n* `__DOCKER_SERVICE_PREFIX__` auto generated by cli, value as `docker_\u003cprofile_name\u003e_\u003cservice_name\u003e`\n* `*_PORTS` can be found under `env/etc/docker/.PORTS`.\\\nHighly recommend your new service has default dynamic env binding port to outside, as it will be easier to running with profiles later\n\n## Profile\n\nset:\n```\ncli -p new_to_env set ADMINER_PORT=4444\n```\n\nThen run docker service with profile:\n```\ncli -p new_to_env docker run adminer\n```\nThis will up and running `cli_new_to_env_adminer` container on port `4444`, cause the profile override the default `ADMINER_PORT=4000`\n\nrun:\n```\ncli -p new_to_env run npm run dev\n```\n\nSuppose you have service written in javascript, you can facilitate using profile with all its `.env` config and apply to process that run `npm run dev`.\n\n## Config file:\nRun all services:\n```bash\ncli up ./test/config.dev.yaml\n```\n\nRun optional services:\n```\ncli up ./test/config.dev.yaml node something\n```\n\n```yaml\nversion: '2.1'\nimport_profile: service\n\nenv:\n  - ADMINER_PORT=5555\n  - SAY=Bonjour\n\ndockers:\n  - redis\n  - adminer\n\nrun:\n  - node\n  - php\n  - something\n  # - not_run\n\njobs:\n  something:\n    env:\n      - THIS=THIS\n      - WILLDO=WILLDO\n    path: $__ENV_ROOT__/test/\n    run: chmod +x ./willdo.sh \u0026\u0026 ./willdo.sh\n\n  node:\n    import_profile: pt\n    env:\n      - NAME=CLI\n      - SAY=$SAY\n    path: $__ENV_ROOT__/test/\n    run: node ./service.js\n\n  php:\n    env:\n      - SAY=$SAY\n      - NAME=CLI_PHP\n    path: $__ENV_ROOT__/test/\n    run: php -S localhost:8080 router.php\n\n  not_run:\n    env:\n      - SAY=This should not be running\n      - NAME=CLI_PHP\n    path: $__ENV_ROOT__/somewhere/\n    run: php -S localhost:8080 router.php\n  # also_not_run:\n    # env:\n      # - SAY=This should not be running\n      # - NAME=CLI_PHP\n    # path: $__ENV_ROOT__/somewhere/\n    # run: php -S localhost:8080 router.php\n```\n\nenv scope:\n`default (.PORTS) -\u003e profile(etc/config/\u003cprofile\u003e/.env) -\u003e [env] from config file`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluanphandinh%2Fenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluanphandinh%2Fenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluanphandinh%2Fenv/lists"}