-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (40 loc) · 1.51 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (40 loc) · 1.51 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
# syntax=docker.io/docker/dockerfile:1
FROM --platform=linux/riscv64 cartesi/python:3.10-slim-jammy
ARG MACHINE_EMULATOR_TOOLS_VERSION=0.14.1
ADD https://github.com/cartesi/machine-emulator-tools/releases/download/v${MACHINE_EMULATOR_TOOLS_VERSION}/machine-emulator-tools-v${MACHINE_EMULATOR_TOOLS_VERSION}.deb /
RUN dpkg -i /machine-emulator-tools-v${MACHINE_EMULATOR_TOOLS_VERSION}.deb \
&& rm /machine-emulator-tools-v${MACHINE_EMULATOR_TOOLS_VERSION}.deb
LABEL io.cartesi.rollups.sdk_version=0.9.0
LABEL io.cartesi.rollups.ram_size=128Mi
ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
set -e
apt-get update
# dependências básicas
apt-get install -y --no-install-recommends \
busybox-static=1:1.30.1-7ubuntu3 \
build-essential \
curl \
pkg-config \
libssl-dev
# instalar Rust (necessário para pydantic-core usado pelo eth_abi)
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
echo 'export PATH="/root/.cargo/bin:$PATH"' >> /root/.bashrc
rm -rf /var/lib/apt/lists/* /var/log/* /var/cache/*
useradd --create-home --user-group dapp
EOF
# garantir que o PATH inclua o cargo
ENV PATH="/root/.cargo/bin:/opt/cartesi/bin:${PATH}"
WORKDIR /opt/cartesi/dapp
COPY ./requirements.txt .
RUN <<EOF
set -e
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt --no-cache
find /usr/local/lib -type d -name __pycache__ -exec rm -r {} +
EOF
COPY ./eth_abi_ext.py .
COPY ./dapp.py .
ENV ROLLUP_HTTP_SERVER_URL="http://127.0.0.1:5004"
ENTRYPOINT ["rollup-init"]
CMD ["python3", "dapp.py"]