diff --git a/Dockerfile b/Dockerfile index 7d2db3a6..f29aea1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,47 @@ -FROM node:9.3 +FROM python:latest -ARG BUILD_TYPE=stable +# +# setup +# +RUN apt-get update +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - +RUN apt-get install -y nodejs wget dpkg git python python3 python3-pip xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 +RUN npm install -g yarn -WORKDIR /trezor-wallet-app +# +# build emulator +# +RUN mkdir /trezor-emulator +WORKDIR /trezor-emulator -COPY package.json /trezor-wallet-app -COPY yarn.lock /trezor-wallet-app +RUN git clone https://github.com/trezor/trezor-core +WORKDIR /trezor-emulator/trezor-core +RUN git submodule update --init --recursive -RUN yarn install +RUN apt-get install libusb-1.0-0 +RUN pip3 install scons trezor +RUN make build_unix_noui -COPY . /trezor-wallet-app +# +# install bridge +# +RUN mkdir /trezor-bridge +WORKDIR /trezor-bridge +RUN wget https://wallet.trezor.io/data/bridge/2.0.25/trezor-bridge_2.0.25_amd64.deb +RUN dpkg -x /trezor-bridge/trezor-bridge_2.0.25_amd64.deb /trezor-bridge -RUN yarn run build:${BUILD_TYPE} +# +# install trezor-wallet +# +RUN mkdir /trezor-wallet +WORKDIR /trezor-wallet +COPY package.json /trezor-wallet +COPY yarn.lock /trezor-wallet +RUN yarn +COPY . /trezor-wallet +RUN yarn run build:stable -EXPOSE 8080 -CMD [ "yarn", "run", "prod-server" ] \ No newline at end of file +# +# run +# +ENTRYPOINT ["/trezor-wallet/test/docker/run-all.sh"] \ No newline at end of file diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile deleted file mode 100644 index 7b582884..00000000 --- a/test/docker/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM node:9 \ No newline at end of file diff --git a/test/docker/docker-compose.yml b/test/docker/docker-compose.yml deleted file mode 100644 index 5ab08796..00000000 --- a/test/docker/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3' -services: - trezor-wallet-tests: - depends_on: - - trezor-emulator - - trezor-bridge - trezor-emulator: - image: registry.corp.sldev.cz/trezor/trezor-core/trezor-emulator - trezor-bridge: - image: registry.corp.sldev.cz/trezor/trezord-go/trezor-bridge \ No newline at end of file diff --git a/test/docker/run-all.sh b/test/docker/run-all.sh new file mode 100755 index 00000000..3fbb9508 --- /dev/null +++ b/test/docker/run-all.sh @@ -0,0 +1 @@ +ls \ No newline at end of file