Term / Dockerfile
soxogvv's picture
Update Dockerfile
d8eb8a5 verified
# ─── Base ──────────────────────────────────────────────────────────────────
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PIP_ROOT_USER_ACTION=ignore
# ─── System packages (NO nodejs/npm here β€” installed via NodeSource below) ──
RUN apt-get update && apt-get install -y --no-install-recommends \
bash bash-completion nano vim less \
tmux screen htop procps \
python3 python3-pip python3-venv python3-dev \
curl wget git netcat-openbsd dnsutils iputils-ping \
build-essential gcc g++ make \
zip unzip tar gzip bzip2 xz-utils \
jq bc sed gawk \
ca-certificates locales \
&& rm -rf /var/lib/apt/lists/*
# ─── Locale ─────────────────────────────────────────────────────────────────
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
# ─── Node.js 20 LTS via NodeSource ──────────────────────────────────────────
# Key: do NOT pre-install nodejs/npm above β€” zero package conflict this way.
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& node --version && npm --version
# ─── Python venv (pip works with no extra flags ever) ────────────────────────
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --upgrade pip setuptools wheel
# ─── Workspace & app dirs ────────────────────────────────────────────────────
RUN mkdir -p /workspace /app && chmod 777 /workspace
WORKDIR /app
# ─── Python deps (cached layer) ──────────────────────────────────────────────
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ─── App source ──────────────────────────────────────────────────────────────
COPY . .
# ─── Nice shell defaults ──────────────────────────────────────────────────────
RUN printf '%s\n' \
'export PS1="\[\e[38;5;40m\]\u\[\e[0m\]@\[\e[38;5;33m\]webterminal\[\e[0m\]:\[\e[38;5;33m\]\w\[\e[0m\]\$ "' \
'alias ll="ls -lah --color=auto"' \
'alias la="ls -A"' \
'alias py="python3"' \
'cd /workspace' \
>> /root/.bashrc
EXPOSE 7860
CMD ["python", "app.py"]