From cf45986eab340c78e696e3526ae39fd49d28b4dc Mon Sep 17 00:00:00 2001 From: Mikael Lindlof Date: Sat, 5 Dec 2020 10:48:03 +0000 Subject: [PATCH] React Docker building --- web/Dockerfile | 4 ++-- web/docker-build.yaml | 14 ++++++++++++++ web/docker-compose.yaml | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 web/docker-build.yaml diff --git a/web/Dockerfile b/web/Dockerfile index 795828d..6311631 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,6 +1,6 @@ -FROM node:15.2.1 +FROM node:15.3.0 WORKDIR /app COPY package.json package-lock.json /app/ RUN npm install COPY . /app -CMD ["npm", "run", "start"] +CMD ["npm", "run", "build"] diff --git a/web/docker-build.yaml b/web/docker-build.yaml new file mode 100644 index 0000000..968295f --- /dev/null +++ b/web/docker-build.yaml @@ -0,0 +1,14 @@ +version: '3.8' +services: + web: + build: + context: . + command: ['npm', 'run', 'build'] + environment: + - 'REACT_APP_CHAIN_ID=${REACT_APP_CHAIN_ID}' + - 'REACT_APP_CHAIN_NAME=${REACT_APP_CHAIN_NAME}' + - 'REACT_APP_LCD_URL=${REACT_APP_LCD_URL}' + - 'REACT_APP_RPC_URL=${REACT_APP_RPC_URL}' + - 'REACT_APP_CONTRACT=${REACT_APP_CONTRACT}' + volumes: + - './build/:/app/build' diff --git a/web/docker-compose.yaml b/web/docker-compose.yaml index 8c5ce78..61c4452 100644 --- a/web/docker-compose.yaml +++ b/web/docker-compose.yaml @@ -4,6 +4,7 @@ services: stdin_open: true build: context: . + command: ['npm', 'run', 'start'] environment: - 'REACT_APP_CHAIN_ID=${REACT_APP_CHAIN_ID}' - 'REACT_APP_CHAIN_NAME=${REACT_APP_CHAIN_NAME}'