Update Dockerfile
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
|
@@ -5,9 +5,10 @@ FROM ubuntu:22.04
|
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
| 7 |
|
| 8 |
-
# Install
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
curl wget git htop nano vim python3 python3-pip sudo zsh tmux unzip locales \
|
|
|
|
| 11 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Web Terminal (ttyd) Setup - Silent and secure download
|
|
@@ -24,7 +25,6 @@ ENV PATH="/home/user/.local/bin:${PATH}"
|
|
| 24 |
WORKDIR $HOME/app
|
| 25 |
|
| 26 |
# ULTRA-FAST ZSH SETUP (No Oh-My-Zsh, zero lag, instant response)
|
| 27 |
-
# We create a custom beautiful prompt that loads in 0.001 seconds
|
| 28 |
RUN echo "autoload -U colors && colors" > ~/.zshrc \
|
| 29 |
&& echo "PROMPT=$'\n%{$fg[cyan]%}%~%{$reset_color%}\n%{$fg[green]%}❯%{$reset_color%} '" >> ~/.zshrc \
|
| 30 |
&& echo "alias ll='ls -alF'" >> ~/.zshrc \
|
|
@@ -45,8 +45,8 @@ RUN echo 'set -g default-terminal "screen-256color"' > ~/.tmux.conf \
|
|
| 45 |
&& echo 'set -g pane-border-style fg="#333333"' >> ~/.tmux.conf \
|
| 46 |
&& echo 'set -g pane-active-border-style fg="#555555",bg=default' >> ~/.tmux.conf
|
| 47 |
|
| 48 |
-
# Copy
|
| 49 |
-
COPY --chown=user:user . $HOME/app
|
| 50 |
|
| 51 |
# Safely install Python Requirements
|
| 52 |
RUN if grep -q '^[^#[:space:]]' requirements.txt; then \
|
|
@@ -56,6 +56,11 @@ RUN if grep -q '^[^#[:space:]]' requirements.txt; then \
|
|
| 56 |
echo "No active python packages found to install."; \
|
| 57 |
fi
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
EXPOSE 7860
|
| 60 |
|
|
|
|
| 61 |
CMD ["python3", "app.py"]
|
|
|
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
| 7 |
|
| 8 |
+
# Install Core Professional Tools + Network Diagnostic Tools (net-tools, iproute2, lsof)
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
curl wget git htop nano vim python3 python3-pip sudo zsh tmux unzip locales \
|
| 11 |
+
net-tools iproute2 lsof procps \
|
| 12 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# Web Terminal (ttyd) Setup - Silent and secure download
|
|
|
|
| 25 |
WORKDIR $HOME/app
|
| 26 |
|
| 27 |
# ULTRA-FAST ZSH SETUP (No Oh-My-Zsh, zero lag, instant response)
|
|
|
|
| 28 |
RUN echo "autoload -U colors && colors" > ~/.zshrc \
|
| 29 |
&& echo "PROMPT=$'\n%{$fg[cyan]%}%~%{$reset_color%}\n%{$fg[green]%}❯%{$reset_color%} '" >> ~/.zshrc \
|
| 30 |
&& echo "alias ll='ls -alF'" >> ~/.zshrc \
|
|
|
|
| 45 |
&& echo 'set -g pane-border-style fg="#333333"' >> ~/.tmux.conf \
|
| 46 |
&& echo 'set -g pane-active-border-style fg="#555555",bg=default' >> ~/.tmux.conf
|
| 47 |
|
| 48 |
+
# 🚀 OPTIMIZATION: Copy requirements first to leverage Docker Layer Caching
|
| 49 |
+
COPY --chown=user:user requirements.txt $HOME/app/
|
| 50 |
|
| 51 |
# Safely install Python Requirements
|
| 52 |
RUN if grep -q '^[^#[:space:]]' requirements.txt; then \
|
|
|
|
| 56 |
echo "No active python packages found to install."; \
|
| 57 |
fi
|
| 58 |
|
| 59 |
+
# Copy the rest of the project files
|
| 60 |
+
COPY --chown=user:user . $HOME/app
|
| 61 |
+
|
| 62 |
+
# Port for ttyd or FastAPI
|
| 63 |
EXPOSE 7860
|
| 64 |
|
| 65 |
+
# Default execution command
|
| 66 |
CMD ["python3", "app.py"]
|