How to deploy pwa-studio on server in production mode?
-
13-02-2021 - |
Вопрос
I have successfully installed PWA-studio with Magento 2.3. But I am not able to run it on production mode on a Ubuntu 18.04 LTS server so that we can access the PWA remotely but I am always able to start the application in development mode which only accessible locally.
How I can configure my server as well as the PWA-studio so that we can access the application remotely?
Решение
- git clone https://github.com/magento-research/pwa-studio.git
- cd pwa-studio
- npm install
- cp packages/venia-concept/.env.dist packages/venia-concept/.env
- edit and change MAGENTO_BACKEND_URL in packages/venia-concept/.env
- In pwa-studio folder run: npm run build && NODE_ENV=production PORT=8000 npm run stage:venia
It will start the server on port 8000.
I used PM2 to manage node services.
(cd packages/venia-concept/ && NODE_ENV=production PORT=8000 node server.js)
Then I made Nginx proxy to pass connection from 8000 to 80 and 443
Hope it helps.
Не связан с magento.stackexchange