-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.testnet
47 lines (40 loc) · 1.58 KB
/
Dockerfile.testnet
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
FROM node:15.14-alpine as build-stage
RUN apk add --no-cache --update \
python \
python-dev \
py-pip \
build-base \
git \
sudo
WORKDIR /app
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
RUN npm install -g npm@7
RUN git clone https://github.com/velas/web3t.git web3t
RUN cd web3t && git checkout testnet
COPY . wallet
WORKDIR /app/web3t
RUN npm install
WORKDIR /app/wallet
RUN mkdir -p .compiled-ssr
RUN cp -pr /app/web3t .compiled-ssr/web3t
WORKDIR /app/wallet
RUN mkdir -p /app/wallet/.compiled-ssr/web3t/providers /app/wallet/.compiled-ssr/web3t/node_modules_embed/ethereumjs-tx
RUN npm install --ignore-scripts --legacy-peer-deps
# npm install is failed sometimes; added retry in case of fail
RUN npm i lsxc -g
RUN mkdir -p /app/wallet/.compiled-ssr/web3t/node_modules_embed/scryptsy/lib
RUN npm rebuild node-sass
RUN npm run wallet-build
FROM nginx:stable-alpine as production-stage
ADD nginx_config/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /app/wallet/.compiled/main-bundle.js /usr/share/nginx/html
COPY --from=build-stage /app/wallet/.compiled/main-bundle.css /usr/share/nginx/html
COPY --from=build-stage /app/wallet/.compiled/service-worker.js /usr/share/nginx/html
COPY --from=build-stage /app/wallet/.compiled/main-index.html /usr/share/nginx/html/index.html
COPY --from=build-stage /app/wallet/frame.html /usr/share/nginx/html/frame.html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]