File size: 3,007 Bytes
adc43e4
 
 
 
 
 
 
d8eb8a5
adc43e4
 
 
 
 
 
 
 
d8eb8a5
adc43e4
 
 
 
 
 
d8eb8a5
 
adc43e4
 
d8eb8a5
 
adc43e4
d8eb8a5
adc43e4
 
 
 
d8eb8a5
adc43e4
 
 
d8eb8a5
adc43e4
 
 
d8eb8a5
adc43e4
 
d8eb8a5
 
 
 
 
 
 
 
adc43e4
 
d8eb8a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ─── 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"]