forked from latticexyz/mud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (50 loc) · 1.95 KB
/
Dockerfile
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
FROM docker.io/library/debian:bullseye-slim as base
ENV SHELL /bin/bash
WORKDIR /opt
RUN apt-get -y update --fix-missing && \
apt-get -y upgrade && \
apt-get install -y --no-install-recommends \
libssl-dev make cmake graphviz \
git pkg-config curl time rhash ca-certificates jq \
python3 python3-pip lsof ruby ruby-bundler git-restore-mtime xz-utils zstd unzip gnupg protobuf-compiler \
wget net-tools iptables iproute2 iputils-ping ed zlib1g-dev wabt
# node.js
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y nodejs && \
node --version && \
npm --version
# go
ARG TARGETPLATFORM
ENV PATH="${PATH}:/usr/local/go/bin"
RUN case ${TARGETPLATFORM} in \
linux/arm64) wget -O go.tar.gz https://dl.google.com/go/go1.20.4.linux-arm64.tar.gz ;; \
linux/amd64) wget -O go.tar.gz https://dl.google.com/go/go1.20.4.linux-amd64.tar.gz ;; \
*) echo "Unsupported platform: ${TARGETPLATFORM}" && exit 1 ;; \
esac
# -C to move to given directory
RUN tar -C /usr/local/ -xzf go.tar.gz && \
go version
# foundry
ENV PATH="${PATH}:/root/.foundry/bin"
RUN curl -L https://foundry.paradigm.xyz/ | bash && \
${HOME}/.foundry/bin/foundryup && \
forge --version && \
cast --version && \
anvil --version && \
chisel --version
# pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="${PATH}:${PNPM_HOME}"
RUN npm install pnpm --global && pnpm --version
FROM base AS mud
COPY . /app
WORKDIR /app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run -r build
FROM mud AS store-indexer
WORKDIR /app/packages/store-indexer
EXPOSE 3001
ENTRYPOINT ["pnpm", "start:sqlite"]