From 49c2d53ef3d8c79d67127e202c4e0555b7d81bd5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Oct 2025 22:44:37 +0000 Subject: [PATCH 1/4] Initial plan From abe2812ba30fd85b7ddb8651708c16c6a44bd812 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Oct 2025 22:47:33 +0000 Subject: [PATCH 2/4] Add .zshrc.prod for production images Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- .zshrc.prod | 56 +++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 4 ++++ alpine.Dockerfile | 4 ++++ 3 files changed, 64 insertions(+) create mode 100644 .zshrc.prod diff --git a/.zshrc.prod b/.zshrc.prod new file mode 100644 index 0000000..a8045f7 --- /dev/null +++ b/.zshrc.prod @@ -0,0 +1,56 @@ +. /etc/profile.d/env.sh + +# Oh My Zsh configuration +export ZSH="$HOME/.oh-my-zsh" + +# Path configuration +export PATH="$HOME/.local/bin:/usr/local/bin:$PATH" + +# Load completions +autoload -Uz compinit +if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then + compinit; +else + compinit -C; +fi; + +# Oh My Zsh plugins (only basic plugins available in production) +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# Source base bashrc for aliases +if [ -f $HOME/.bash_aliases ]; then + . $HOME/.bash_aliases +fi + +# Keybindings +bindkey -e +bindkey ';5A' history-search-backward +bindkey ';5B' history-search-forward +bindkey ";5C" forward-word +bindkey ";5D" backward-word +bindkey "^[[3~" delete-char + +# History configuration +HISTSIZE=500 +HISTFILE=~/.zsh_history +SAVEHIST=$HISTSIZE +HISTDUP=erase +setopt appendhistory +setopt sharehistory +setopt hist_ignore_space +setopt hist_ignore_all_dups +setopt hist_save_no_dups +setopt hist_ignore_dups +setopt hist_find_no_dups + +# Completion styling +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' menu select + +# FNM environment (if available) +if command -v fnm >/dev/null 2>&1; then + eval "$(fnm env --use-on-cd --shell zsh)" +fi diff --git a/Dockerfile b/Dockerfile index 6b3688c..8136275 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,5 +108,9 @@ FROM base AS prod RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" +USER root +COPY --chown=${USER}:${USER} ./.zshrc.prod /home/${USER}/.zshrc +USER ${USER} + WORKDIR /app USER ${USER} \ No newline at end of file diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 7f6d4c9..be5060e 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -96,5 +96,9 @@ FROM base AS prod RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" +USER root +COPY --chown=${USER}:${USER} ./.zshrc.prod /home/${USER}/.zshrc +USER ${USER} + WORKDIR /app USER ${USER} \ No newline at end of file From 3420e2da3796ce16b9ec833ef726f0060f4ac0f8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Oct 2025 22:52:26 +0000 Subject: [PATCH 3/4] Update documentation for production zsh configuration Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- README-ALPINE.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README-ALPINE.md b/README-ALPINE.md index f23e40c..63e93e0 100644 --- a/README-ALPINE.md +++ b/README-ALPINE.md @@ -57,12 +57,13 @@ Both Alpine and Bookworm variants provide the same functionality: - ✅ Node.js via FNM (Fast Node Manager) - ✅ Supervisor process manager - ✅ PostgreSQL and MySQL clients +- ✅ Zsh with Oh My Zsh (basic configuration) ### Development Features (in -dev variants) - ✅ Xdebug PHP extension - ✅ GitHub CLI (`gh`) -- ✅ Developer tools (htop, nano, starship prompt) -- ✅ Zsh with Oh My Zsh and plugins +- ✅ Developer tools (htop, nano, starship prompt, eza, fzf) +- ✅ Enhanced Zsh configuration with additional plugins - ✅ Custom aliases and environment ### Image Optimization Tools @@ -131,6 +132,8 @@ This generates 16 total image variants (2 PHP × 2 OS × 2 types × 2 platforms) - `alpine.Dockerfile` - Alpine variant - `docker-bake.hcl` - Build configuration - `env.sh` - Shared environment setup +- `.zshrc` - Zsh configuration for development images +- `.zshrc.prod` - Zsh configuration for production images - `test.php` - Functionality testing script ### Adding New Features From 178a2df8e5bef3dc1a142b23ef329ce127c8cac2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Oct 2025 05:45:24 +0000 Subject: [PATCH 4/4] Add missing dev-only binaries to test.php Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.php b/test.php index 735dcf8..7888f75 100644 --- a/test.php +++ b/test.php @@ -17,7 +17,7 @@ const PRODUCTION_ONLY_BINARIES = []; -const DEV_ONLY_BINARIES = ['gh', 'htop', 'nano']; +const DEV_ONLY_BINARIES = ['gh', 'htop', 'nano', 'fzf', 'eza', 'starship', 'zoxide', 'opencode']; const DEV_BINARIES = [ ...PRODUCTION_BINARIES,