1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 10:48:22 +00:00

Export resources while docker build

This commit is contained in:
Vladimir Volek 2018-10-24 17:18:28 +02:00 committed by Szymon Lesisz
parent d91a043967
commit b1fe64867d
2 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,7 @@
FROM node:8 FROM node:8
ARG BUILD_TYPE=prod
WORKDIR /trezor-wallet-app WORKDIR /trezor-wallet-app
COPY package.json /trezor-wallet-app COPY package.json /trezor-wallet-app
@ -9,7 +11,7 @@ RUN yarn install
COPY . /trezor-wallet-app COPY . /trezor-wallet-app
RUN yarn run build:prod RUN yarn run build:${BUILD_TYPE}
EXPOSE 8080 EXPOSE 8080
CMD [ "yarn", "run", "prod-server" ] CMD [ "yarn", "run", "prod-server" ]

View File

@ -1,4 +1,16 @@
#!/bin/bash #!/bin/bash
cd "$(dirname "$0")" cd "$(dirname "$0")"
docker build -t trezor-wallet ../
if [[ "$1" == "dev" || "$1" == 'beta' || "$1" == 'prod' ]]
then
docker stop trezor-wallet
docker rm trezor-wallet
docker build -t trezor-wallet ../ --build-arg BUILD_TYPE=$1
docker run -p 8080:8080 -d --name trezor-wallet trezor-wallet:latest
docker cp trezor-wallet:/trezor-wallet-app/build/$1 ../build/
docker stop trezor-wallet
docker rm trezor-wallet
else
echo "invalid parameters... valid parameters are (beta, dev, prod)"
fi