-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.server
More file actions
84 lines (69 loc) · 2.88 KB
/
Dockerfile.server
File metadata and controls
84 lines (69 loc) · 2.88 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
76
77
78
79
80
81
82
83
84
# Stage 1: Build TypeScript
FROM node:22-slim AS builder
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app/server
COPY server/package.json server/pnpm-lock.yaml* ./
RUN pnpm install --frozen-lockfile || pnpm install
COPY server/tsconfig.json ./
COPY server/src ./src
RUN pnpm run build
# Stage 2: Runtime with ZK toolchain
FROM node:22-trixie
# Install system deps for Python 3.10 build + general tooling
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
bash \
ca-certificates \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libncursesw5-dev \
libxml2-dev \
libxmlsec1-dev \
libffi-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python 3.10 from source (garaga requires >=3.10,<3.11)
ARG PYTHON_VERSION=3.10.16
RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | tar xz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure --enable-optimizations --prefix=/usr/local/python310 \
&& make -j$(nproc) \
&& make install \
&& cd / && rm -rf Python-${PYTHON_VERSION}
ENV PATH="/usr/local/python310/bin:${PATH}"
RUN python3.10 -m pip install --upgrade pip && python3.10 -m pip install garaga==1.0.1
# Symlink garaga to a known path
RUN ln -s /usr/local/python310/bin/garaga /usr/local/bin/garaga
# Install nargo directly from GitHub release (no installer scripts in Docker)
ARG NARGO_VERSION=1.0.0-beta.16
RUN mkdir -p /usr/local/nargo \
&& curl -fsSL "https://github.com/noir-lang/noir/releases/download/v${NARGO_VERSION}/nargo-x86_64-unknown-linux-gnu.tar.gz" \
| tar xz -C /usr/local/nargo \
&& chmod +x /usr/local/nargo/nargo
ENV PATH="/usr/local/nargo:${PATH}"
# Install bb directly from GitHub release
ARG BB_VERSION=3.0.0-nightly.20251104
RUN mkdir -p /usr/local/bb \
&& curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${BB_VERSION}/barretenberg-amd64-linux.tar.gz" \
| tar xz -C /usr/local/bb \
&& chmod +x /usr/local/bb/bb
ENV PATH="/usr/local/bb:${PATH}"
WORKDIR /app
# Copy compiled server
COPY --from=builder /app/server/dist ./server/dist
COPY --from=builder /app/server/node_modules ./server/node_modules
COPY server/package.json ./server/
# Copy circuit sources and precompiled artifacts
COPY circuits/tweetle_wordle/Nargo.toml circuits/tweetle_wordle/Nargo.toml
COPY circuits/tweetle_wordle/src/ circuits/tweetle_wordle/src/
COPY circuits/tweetle_wordle/target/tweetle_wordle.json circuits/tweetle_wordle/target/tweetle_wordle.json
COPY circuits/tweetle_wordle/target/vk/ circuits/tweetle_wordle/target/vk/
COPY circuits/tweetle_commitment/Nargo.toml circuits/tweetle_commitment/Nargo.toml
COPY circuits/tweetle_commitment/src/ circuits/tweetle_commitment/src/
ENV NODE_ENV=production
ENV PORT=3001
EXPOSE 3001
CMD ["node", "server/dist/index.js"]