From cc8f45073ea5edd52c82331a04689eccd0de4eeb Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Thu, 20 Jun 2024 13:59:54 +0200 Subject: [PATCH 1/4] refactor bridge fe dockerfile --- contracts/src/bridge/frontend/Dockerfile | 32 ++++++------------------ 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/contracts/src/bridge/frontend/Dockerfile b/contracts/src/bridge/frontend/Dockerfile index 720f4395b0..db8096de46 100644 --- a/contracts/src/bridge/frontend/Dockerfile +++ b/contracts/src/bridge/frontend/Dockerfile @@ -1,27 +1,9 @@ -# Use an official Node.js 22 as a parent image -FROM node:22-alpine - -WORKDIR /usr/src/app - -# ARG for build-time variable -ARG API_HOST -ARG L1_BRIDGE -ARG L2_BRIDGE -ARG MESSAGE_BUS -ARG GOOGLE_ANALYTICS_ID - -# ENV for URL to be used in the app -ENV NEXT_PUBLIC_BRIDGE_API_HOST=${API_HOST} -ENV NEXT_PUBLIC_BRIDGE_L1=${L1_BRIDGE} -ENV NEXT_PUBLIC_BRIDGE_L2=${L2_BRIDGE} -ENV NEXT_PUBLIC_BRIDGE_MESSAGE_BUS=${MESSAGE_BUS} -ENV NEXT_PUBLIC_BRIDGE_GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID} - -# Copy package.json and package-lock.json (or yarn.lock) into the container -COPY package*.json ./ +FROM node:18-buster as runner +# setup container data structure +RUN mkdir -p /home/obscuro/go-ten/tools/contracts/src/bridge +COPY ./contracts/src/bridge/frontend /home/obscuro/go-ten/contracts/src/bridge/frontend +WORKDIR /home/obscuro/go-ten/tools/tenscan/frontend RUN npm install -COPY . . -RUN npm run build -EXPOSE 80 -CMD ["npm", "start"] \ No newline at end of file + +EXPOSE 80 \ No newline at end of file From 91445d4be4b8c775bb9832f20e46d3fdf2bd04e9 Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Thu, 20 Jun 2024 14:04:50 +0200 Subject: [PATCH 2/4] update relative path --- contracts/src/bridge/frontend/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/src/bridge/frontend/Dockerfile b/contracts/src/bridge/frontend/Dockerfile index db8096de46..fdb491f64f 100644 --- a/contracts/src/bridge/frontend/Dockerfile +++ b/contracts/src/bridge/frontend/Dockerfile @@ -1,9 +1,9 @@ FROM node:18-buster as runner # setup container data structure -RUN mkdir -p /home/obscuro/go-ten/tools/contracts/src/bridge -COPY ./contracts/src/bridge/frontend /home/obscuro/go-ten/contracts/src/bridge/frontend +RUN mkdir -p /home/obscuro/go-obscuro/contracts/src/bridge +COPY ./contracts/src/bridge/frontend /home/obscuro/go-obscuro/contracts/src/bridge/frontend -WORKDIR /home/obscuro/go-ten/tools/tenscan/frontend +WORKDIR /home/obscuro/go-obscuro/contracts/src/bridge/frontend RUN npm install EXPOSE 80 \ No newline at end of file From b6db02d189ec160a6800e337066b4a6132f5e17d Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Thu, 20 Jun 2024 14:26:10 +0200 Subject: [PATCH 3/4] update Dockerfile path --- contracts/src/bridge/frontend/Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contracts/src/bridge/frontend/Dockerfile b/contracts/src/bridge/frontend/Dockerfile index fdb491f64f..0237322b36 100644 --- a/contracts/src/bridge/frontend/Dockerfile +++ b/contracts/src/bridge/frontend/Dockerfile @@ -4,6 +4,21 @@ RUN mkdir -p /home/obscuro/go-obscuro/contracts/src/bridge COPY ./contracts/src/bridge/frontend /home/obscuro/go-obscuro/contracts/src/bridge/frontend WORKDIR /home/obscuro/go-obscuro/contracts/src/bridge/frontend + +# ARG for build-time variable +ARG API_HOST +ARG L1_BRIDGE +ARG L2_BRIDGE +ARG MESSAGE_BUS +ARG GOOGLE_ANALYTICS_ID + +# ENV for URL to be used in the app +ENV NEXT_PUBLIC_BRIDGE_API_HOST=${API_HOST} +ENV NEXT_PUBLIC_BRIDGE_L1=${L1_BRIDGE} +ENV NEXT_PUBLIC_BRIDGE_L2=${L2_BRIDGE} +ENV NEXT_PUBLIC_BRIDGE_MESSAGE_BUS=${MESSAGE_BUS} +ENV NEXT_PUBLIC_BRIDGE_GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID} + RUN npm install EXPOSE 80 \ No newline at end of file From 040ca44ae6ab2db4f53d2e0e1367a711e0c2756f Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Thu, 20 Jun 2024 14:37:24 +0200 Subject: [PATCH 4/4] update to recent node version --- contracts/src/bridge/frontend/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/src/bridge/frontend/Dockerfile b/contracts/src/bridge/frontend/Dockerfile index 0237322b36..3d9032af61 100644 --- a/contracts/src/bridge/frontend/Dockerfile +++ b/contracts/src/bridge/frontend/Dockerfile @@ -1,4 +1,6 @@ -FROM node:18-buster as runner +# Use an official Node.js 22 as a parent image +FROM node:22-alpine + # setup container data structure RUN mkdir -p /home/obscuro/go-obscuro/contracts/src/bridge COPY ./contracts/src/bridge/frontend /home/obscuro/go-obscuro/contracts/src/bridge/frontend