This repository has been archived by the owner on Jul 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
46 lines (35 loc) · 1.56 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
FROM node:10-buster
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly -y
ENV PATH=/root/.cargo/bin:$PATH
COPY rust-toolchain /root/salad/rust-toolchain
RUN export RUST_TOOLCHAIN=$(cat /root/salad/rust-toolchain) && \
rustup toolchain add $RUST_TOOLCHAIN --target wasm32-unknown-unknown
COPY .env.template /root/salad/.env
COPY client/ /root/salad/client/
COPY config/ /root/salad/config/
COPY docker-compose.cli-sw.yml /root/salad/docker-compose.cli-sw.yml
COPY migrations/ /root/salad/migrations/
COPY operator/ /root/salad/operator/
COPY package.json /root/salad/package.json
COPY secret_contracts/ /root/salad/secret_contracts/
COPY smart_contracts/ /root/salad/smart_contracts/
COPY test/ /root/salad/test/
COPY truffle.js /root/salad/truffle.js
COPY yarn.lock /root/salad/yarn.lock
WORKDIR /root/salad
RUN yarn install
RUN yarn add -W async
RUN sed -i "s/ETH_HOST=localhost/ETH_HOST=contract/" .env && \
sed -i "s/ENIGMA_HOST=localhost/ENIGMA_HOST=nginx/" .env && \
sed -i "s/localhost:27017/mongo:27017/" .env && \
sed -i "s/SGX_MODE=HW/SGX_MODE=SW/" .env
RUN cp operator/.env.template operator/.env && \
sed -i "s/ETH_HOST=localhost/ETH_HOST=contract/" operator/.env && \
sed -i "s/ENIGMA_HOST=localhost/ENIGMA_HOST=nginx/" operator/.env && \
sed -i "s/localhost:27017/mongo:27017/" operator/.env
RUN cp docker-compose.cli-sw.yml docker-compose.yml && \
sed -i "s/host: 'localhost'/host: 'contract'/" truffle.js
RUN npx truffle compile
RUN npx discovery compile
ENTRYPOINT ["/usr/bin/env"]
CMD ["/bin/bash"]