-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (57 loc) · 2.35 KB
/
Dockerfile
File metadata and controls
75 lines (57 loc) · 2.35 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# === 🏗️ مرحلة البناء ===
FROM debian:bookworm-slim AS builder
ENV NODE_VERSION=22.15.0 \
YARN_VERSION=1.22.22 \
PATH="/opt/venv/bin:/root/.foundry/bin:/root/.cyfrin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# 🔧 Install build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl wget gnupg ca-certificates \
coreutils git python3 python3-pip python3-venv xz-utils \
make bash g++ gcc && \
ln -sf /bin/bash /bin/sh && \
rm -rf /var/lib/apt/lists/*
# 🧱 Install Node.js
RUN ARCH=linux-x64 && \
curl -fsSL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-$ARCH.tar.xz | \
tar -xJ --strip-components=1 -C /usr/local && \
corepack enable pnpm
# 🧪 Install Slither
RUN python3 -m venv /opt/venv && \
/opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
/opt/venv/bin/pip install --no-cache-dir slither-analyzer
# 🔨 Install Foundry
RUN curl -L https://foundry.paradigm.xyz | bash && \
$HOME/.foundry/bin/foundryup
# ⚙️ Install Cyfrinup tools
RUN curl -L https://raw.githubusercontent.com/Cyfrin/up/main/install | bash
# ===========================================
# === 🧊 الصورة النهائية ===
FROM debian:bookworm-slim
ENV PATH="/opt/venv/bin:/root/.foundry/bin:/root/.cyfrin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# 🧩 Install only runtime dependencies (lightweight)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 python3-venv git ca-certificates bash curl xz-utils make nano locales && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen && \
update-locale LANG=en_US.UTF-8 && \
ln -sf /bin/bash /bin/sh && \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# 🧠 Copy needed files from builder
COPY --from=builder /opt/venv /opt/venv
COPY --from=builder /usr/local /usr/local
COPY --from=builder /root/.foundry /root/.foundry
COPY --from=builder /root/.cyfrin /root/.cyfrin
# 🧰 Configure git to use nano as the default editor
RUN git config --global core.editor nano
# 🗂️ Set working directory
WORKDIR /app
# 🧾 Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# 🚀 Launch script
ENTRYPOINT ["/entrypoint.sh"]