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/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 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 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,