diff --git a/apps/wrapper/applicant-portal/dockerfile b/apps/wrapper/applicant-portal/dockerfile index 4a00efbf55658ea9131da08aff1b8641e109836f..6dc89655f7eca26488c4224aa1cd2c78a2eced2b 100644 --- a/apps/wrapper/applicant-portal/dockerfile +++ b/apps/wrapper/applicant-portal/dockerfile @@ -1,37 +1,7 @@ -#get the latest alpine image from node registry -FROM node:16-alpine AS build-stage -RUN npm i -g pnpm - -#set the working directory +FROM node:lts as dependencies WORKDIR /app - -#copy the package and package lock files -#from local to container work directory /app -COPY package.json /app/ -COPY package-lock.json /app/ - -#Run command npm install to install packages +COPY . ./ RUN npm install - -#copy all the folder contents from local to container -COPY . . - -#specify env variables at runtime -ARG REACT_APP_ENKETO_URL -ARG REACT_APP_FORM_MANAGER_URL -ARG REACT_APP_HASURA_URL - -ENV REACT_APP_ENKETO_URL $REACT_APP_ENKETO_URL -ENV REACT_APP_FORM_MANAGER_URL $REACT_APP_FORM_MANAGER_URL -ENV REACT_APP_HASURA_URL $REACT_APP_HASURA_URL - - -#create a react production build RUN npm run build - -#get the latest alpine image from nginx registry -FROM nginx:alpine - -#we copy the output from first stage that is our react build -#into nginx html directory where it will serve our index file -COPY --from=build-stage /app/build/ /usr/share/nginx/html \ No newline at end of file +EXPOSE 3002 +CMD ["npm", "run", "start-prod"] \ No newline at end of file diff --git a/apps/wrapper/applicant-portal/package.json b/apps/wrapper/applicant-portal/package.json index c3140d08867543bc75084855e7419a8e2fb256da..832a14643de4b5f2ef542fb315f83c294eda69a8 100644 --- a/apps/wrapper/applicant-portal/package.json +++ b/apps/wrapper/applicant-portal/package.json @@ -22,6 +22,7 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", + "start-prod": "serve -s build", "test": "react-scripts test", "eject": "react-scripts eject" }, @@ -44,6 +45,7 @@ ] }, "devDependencies": { + "serve": "^14.2.0", "localforage": "^1.10.0", "react-icons": "^4.8.0", "react-xml-parser": "^1.1.8", diff --git a/apps/wrapper/web-portal/dockerfile b/apps/wrapper/web-portal/dockerfile index af9c494bbe304531a9fb8b8888ddabf0715ab9d8..17e48c9a740cc10fc7b02c885cadf98cd0d41f86 100644 --- a/apps/wrapper/web-portal/dockerfile +++ b/apps/wrapper/web-portal/dockerfile @@ -3,5 +3,5 @@ WORKDIR /app COPY . ./ RUN npm install RUN npm run build -EXPOSE 3000 -CMD ["npm", "run", "start-prod"] \ No newline at end of file +EXPOSE 3001 +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/apps/wrapper/web-portal/package.json b/apps/wrapper/web-portal/package.json index 339aff47a16462a64a8bbc41b34b9672b4912d25..0d5c9a3d7cbb8f3d4873798e2f1bfceda9dd4788 100644 --- a/apps/wrapper/web-portal/package.json +++ b/apps/wrapper/web-portal/package.json @@ -53,6 +53,7 @@ ] }, "devDependencies": { + "serve": "^14.2.0", "react-icons": "^4.8.0", "tailwindcss": "^3.3.2" }