-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile_subbridge_e2e
58 lines (41 loc) · 1.64 KB
/
Dockerfile_subbridge_e2e
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
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only
FROM --platform=linux/amd64 paritytech/ci-linux:production as builder
WORKDIR /code
COPY ./scripts/phala-subbridge/khala-e2e.config.json .
# build khala-parachain
RUN git clone https://github.com/Phala-Network/khala-parachain.git ./khala-parachain
WORKDIR /code/khala-parachain
RUN git checkout main
RUN cargo build --release --features=all-runtimes
RUN cp ./target/release/khala-node ./polkadot-launch/bin/
# grab the prebuild polkadot relay chain binary
WORKDIR /code
RUN apt-get update \
&& apt-get install -y wget
RUN wget https://github.com/paritytech/polkadot/releases/download/v0.9.37/polkadot
RUN mv polkadot ./khala-parachain/polkadot-launch/bin/
# grant execution permission
RUN chmod +x ./khala-parachain/polkadot-launch/bin/polkadot
RUN chmod +x ./khala-parachain/polkadot-launch/bin/khala-node
# copy the config file
RUN mv khala-e2e.config.json ./khala-parachain/polkadot-launch/
FROM --platform=linux/amd64 node:18.14.2
WORKDIR /node
COPY --from=builder /code/khala-parachain/polkadot-launch ./polkadot-launch/
COPY --from=builder /code/khala-parachain/scripts/js/setup_sygma.js ./polkadot-launch/scripts/
COPY --from=builder /code/khala-parachain/scripts/js/package.json ./polkadot-launch/scripts/
# yarn install
WORKDIR /node/polkadot-launch
RUN yarn
# setup and launch
WORKDIR /node/polkadot-launch/scripts
COPY scripts/phala-subbridge/e2e_setup.sh .
RUN chmod +x ./e2e_setup.sh
WORKDIR /node/polkadot-launch
# JSON-RPC WS server
EXPOSE 9944
# JSON-RPC HTTP server
EXPOSE 9933
RUN ["./scripts/e2e_setup.sh"]
ENTRYPOINT ["yarn", "start", "khala-e2e.config.json"]