| |
| FROM ubuntu:22.04 |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| curl wget git htop nano vim python3 python3-pip sudo zsh tmux unzip locales \ |
| net-tools iproute2 lsof procps \ |
| && apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN wget -q https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64 -O /usr/local/bin/ttyd \ |
| && chmod +x /usr/local/bin/ttyd |
|
|
| |
| RUN useradd -m -s /bin/zsh -u 1000 user \ |
| && echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers |
|
|
| USER user |
| ENV HOME=/home/user |
| ENV PATH="/home/user/.local/bin:${PATH}" |
| WORKDIR $HOME/app |
|
|
| |
| RUN echo "autoload -U colors && colors" > ~/.zshrc \ |
| && echo "PROMPT=$'\n%{$fg[cyan]%}%~%{$reset_color%}\n%{$fg[green]%}❯%{$reset_color%} '" >> ~/.zshrc \ |
| && echo "alias ll='ls -alF'" >> ~/.zshrc \ |
| && echo "alias la='ls -A'" >> ~/.zshrc \ |
| && echo "alias l='ls -CF'" >> ~/.zshrc \ |
| && echo "clear" >> ~/.zshrc |
|
|
| |
| RUN echo 'set -g default-terminal "screen-256color"' > ~/.tmux.conf \ |
| && echo 'set -g mouse off' >> ~/.tmux.conf \ |
| && echo 'set -s escape-time 0' >> ~/.tmux.conf \ |
| && echo 'set -g history-limit 100000' >> ~/.tmux.conf \ |
| && echo 'set -g status-bg "#000000"' >> ~/.tmux.conf \ |
| && echo 'set -g status-fg "#ffffff"' >> ~/.tmux.conf \ |
| && echo 'set -g status-left-length 50' >> ~/.tmux.conf \ |
| && echo 'set -g status-left "#[fg=#ffffff,bg=#222222,bold] WORKSPACE [#S] #[bg=#000000] "' >> ~/.tmux.conf \ |
| && echo 'set -g status-right "#[fg=#888888]%Y-%m-%d #[fg=#ffffff]%H:%M "' >> ~/.tmux.conf \ |
| && echo 'set -g pane-border-style fg="#333333"' >> ~/.tmux.conf \ |
| && echo 'set -g pane-active-border-style fg="#555555",bg=default' >> ~/.tmux.conf |
|
|
| |
| COPY --chown=user:user requirements.txt $HOME/app/ |
|
|
| |
| RUN if grep -q '^[^#[:space:]]' requirements.txt; then \ |
| pip3 install --no-cache-dir --upgrade pip && \ |
| pip3 install --no-cache-dir -r requirements.txt; \ |
| else \ |
| echo "No active python packages found to install."; \ |
| fi |
|
|
| |
| COPY --chown=user:user . $HOME/app |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["python3", "app.py"] |