承接 hugochinchilla/botanist 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hugochinchilla/botanist

最新稳定版本:v0.2

Composer 安装命令:

composer require hugochinchilla/botanist

包简介

Removes all the roots from your project dir

README 文档

README

Run test suite

banner

Add this plugin to your composer.json to prevent composer from creating files owned by root while running on docker.

composer require hugochinchilla/botanist

Why this project?

Something I like a lot is being able to run any development environment just by running docker compose up after cloning it, without having to set up anything, no need to read the readme file, for me that is devex bliss.

A typical problem setting docker to run with a user different that root is needing to customize your user id in a dotenv file before being able to start the project, and that makes me unhappy.

How does it work?

It sets a hook to run after commands that may write the vendor/ dir or update the composer.lock file. The hook will check the parent dir owner/group and will set the same ownership to the files.

It can only perform this action if composer is run as root, so if you don't install it as root you will not see the ownership changed until you execute any install/update as root.

Is it better than running docker as not root?

No. The best practice is to not run containers as root, but if you are running it as root nonetheless, this will solve a common issue.

What's the alternative?

You can use a mix of a dotenv file and the following snippet:

# .env
USER_ID=1000 # get yours running `id -u`

# docker-compose.yml
services:
  php:
    image: php:some-version
    user: ${USER_ID:-1000}:${USER_ID:-1000}
    ...

This will run the docker container as the same user as yours. If you don't define the USER_ID in the dotenv file it will use 1000 as default value, there is a great chance that this is your id anyway.

But if you want to have a repo that can be cloned by any user and just run with docker compose up without any prior setup, use botanist.

统计信息

  • 总下载量: 58
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2023-09-29