Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .zshrc.prod
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
7 changes: 5 additions & 2 deletions README-ALPINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
2 changes: 1 addition & 1 deletion test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down