A
Alokaiβ€’13mo ago
Tajveez

Deployment guide

Hello Guys, Is there any recommended deployment guide for VSF? I tried searching the official documentation but couldn't find anything. Is there any article or blog that i can follow? P.S. I am trying to deploy VSF on Debian server. Thanks
8 Replies
rohrig
rohrigβ€’13mo ago
Guide to Deploying Vue Storefront on DigitalOcean | Vue Storefront
This guide is intended for developers who are familiar with both Vue Storefront and DigitalOcean and are looking to set up the eCommerce application on the cloud-based hosting service.
Tajveez
Tajveezβ€’13mo ago
Thanks @rohrig , but this seems to be from DigitalOcean UI. i am doing this via ssh.
rohrig
rohrigβ€’13mo ago
have you uploaded the project to a server running node?
Tajveez
Tajveezβ€’13mo ago
yes, project is there. and node, npm, yarn are installed. I am using ngnix so i have already mapped localhost:3000 in ngnix configuration. I have set Magento Url in .env file but when i run yarn build && yarn start I see VSF application but with message error occured. I checked network tab api/magento/route is throwing 502 error. I guess API is not running. Did i missed any step or am i doing something wrong?
rohrig
rohrigβ€’13mo ago
what does yarn start do, run nuxt and the middleware? I just checked and default it only starts the nuxt app. Did you run yarn start:middleware?
Tajveez
Tajveezβ€’13mo ago
i don't think it starts the middleware. do i need to only run yarn start:middleware or both yarn start and yarn start:middleware?
rohrig
rohrigβ€’13mo ago
if you don't want to update the script you must run both. or you can update the script to run both concurrently via one script. see the dev command for an example of running two commands concurrently
Tajveez
Tajveezβ€’13mo ago
thanks, will do. ran yarn start:middleware command but it started middleware at 0.0.0.0:8181 when variables API_BASE_URL and API_SSR_BASE_URL set in .env file. i checked the code at middleware.js file:
const host = process.argv[2] ?? "0.0.0.0";
const port = process.argv[3] ?? 8181;
const host = process.argv[2] ?? "0.0.0.0";
const port = process.argv[3] ?? 8181;
guess its picking default values. @rohrig Do Magento and VSF need to be on same server? In ngnix error.log i see the following errors.
"GET /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://127.0.0.1:3000/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"
"GET /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://127.0.0.1:3000/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"
Also can you guide: VSF is starting middleware at 0.0.0.0:8181 and in .env we are setting following variables for middleware:
# Previously VSF_MIDDLEWARE_URL
API_BASE_URL=http://localhost:3000/api/
# Previously VSF_SSR_MIDDLEWARE_URL
API_SSR_BASE_URL=http://localhost:3000/api/
# Previously VSF_MIDDLEWARE_URL
API_BASE_URL=http://localhost:3000/api/
# Previously VSF_SSR_MIDDLEWARE_URL
API_SSR_BASE_URL=http://localhost:3000/api/
Does VSF automatically map to that or do we need to add reverse proxy for port 8181 ? nvm, graphql was breaking at Magento's end which was causing middleware to break. fixed that and its working perfectly. Thanks for help @rohrig πŸ™Œ .