Question:
How to run expo react native web with the production folder web-build?

If you want to deploy an Expo React Native web app using the production build located in the web-build folder, you can follow these steps:


By using

npx serve web-build


Here is the complete code:


# pull base image


FROM node:lts-alpine



ARG NODE_ENV=production

ENV NODE_ENV $NODE_ENV



ARG PORT=19006

ENV PORT $PORT

EXPOSE $PORT 19001 19002



ENV NPM_CONFIG_PREFIX=/home/node/.npm-global

ENV PATH /home/node/.npm-global/bin:$PATH

RUN npm i --unsafe-perm --allow-root -g npm@latest expo-cli@latest


RUN mkdir /opt/dwl_frontend

WORKDIR /opt/dwl_frontend

ENV PATH /opt/dwl_frontend/.bin:$PATH

COPY package.json yarn.lock ./

RUN yarn

RUN yarn install



WORKDIR /opt/dwl_frontend


COPY ./ ./ 

ENTRYPOINT [ "npx", "serve", "web-build" ]



Suggested blogs:

>Complete guide on Life Cycle of Angular Component

>Complete guide to Perform crud operation in angular using modal popup

>Create a Vue.js application with CLI Services

>Creating API in Python using Flask

>CRUD Operation on Angular

>CRUD Operations In ASP.NET Core Using Entity Framework Core Code First with Angularjs

>Deploying a python App for iOS, Windows, and macOS

>Design a basic Mobile App With the Kivy Python Framework


Ritu Singh

Ritu Singh

Submit
0 Answers