6

I am implementing the vue storefront using the following reference:

https://medium.com/the-vue-storefront-journal/vue-storefront-how-to-install-and-integrate-with-magento2-227767dd65b2

https://docs.vuestorefront.io/guide/installation/linux-mac.html#using-vue-storefront-demo-as-a-backend

I have got the following error:

enter image description here

Can you please provide me all the steps of the docker implementing for vue I am not aware of the docker.

Implementing vue is possible without docker?

Thank you so much in Advanced.

2 Answers 2

5

Answering your question Implementing vue is possible without docker?
In development mode of vuestorefront, you need to install docker from here
You can bypass docker in production mode as vuestorefront does not support it currently.

I have also faced the docker starting issue when I use npm run installer for setup for vuestorefront. so I have performed manual steps which are as below.

Manual steps for the setup of vuestorefront on the local system

1: Clone vuestorefront repo to your Magento root folder. - git clone https://github.com/DivanteLtd/vue-storefront.git vue-storefront - install dependencies using yarn install

2: Clone vuestorefrontapi - git clone https://github.com/DivanteLtd/vue-storefront-api.git vue-storefront-api - install dependencies using yarn install or npm i

3: Copy default config to local config in vue-storefront/config/ and vue-storefront-api/config.

4: Create an integration for magento2 api call and provide details [token info] in vue-storefront-api/config/local.json

5: Go to vuestorefront-api folder and up the docker.

docker-compose up -d

6: Import data of magento2 to elasticsearch. -> yarn mage2vs import -> varify your data on http://localhost:5601/

7: Run below command form vuestorefront and vuestorefront-api -> npm run dev

8: Open localhost:3000 and verify your site.

Restart all instances in manual mode.

1: Go to vuestorefront-api folder and up the docker.

docker-compose up -d

2: Import data of magento2 to elasticsearch. -> yarn mage2vs import -> varify your data on http://localhost:5601/ Indices: vue_storefront_catalog

3: Run below command form vuestorefront and vuestorefront-api -> npm run dev

4: Verify your instance on localhost:3000

Make sure you have installed all prerequisites before setup, which are as below.

1. Docker (with docker-compose installed).
2. Node.js Active LTS (>=10.x)
3. Yarn (>=1.0.0)
4. ImageMagick (to fit, resize and crop images)
5. ElasticSearch
6. Redis

14
  • 1
    change host in your vue-storefront/config/local.json, make sure you have something else URL pointed to your system, and added in /etc/hosts Commented Feb 18, 2020 at 9:09
  • 1
    Please ask different questions regarding how to get the product image can you please describe briefly, will try to answer there Commented Feb 18, 2020 at 9:10
  • 1
    you need to start yarn dev from vue-storefront and vuestorefront-api every time you close the terminal. Commented Feb 18, 2020 at 9:12
  • 1
    @HardikMakwana You need to stop Redis and elastic search which is already running. Commented Feb 24, 2020 at 4:31
  • 1
    sudo service elasticsearch stop for elasticsearch | sudo systemctl stop redis-server.service, you can easily google it. Commented Feb 24, 2020 at 4:38
1

To resolve this error edit the line 197 in path

vue-storefront/core/scripts/installer.js

if (shell.exec(`docker-compose up -d > /dev/null 2>&1`).code !== 0) {

is wrong.

change condition to "sudo docker -composer up -d"

if (shell.exec(`sudo docker-compose up -d`).code !== 0) {

By doing so, docker will successfully install in the background.

/**
   * Run 'docker-compose up' in background
   *
   * @returns {Promise}
   */
  dockerComposeUp () {
    return new Promise((resolve, reject) => {
      Message.info('Starting Docker in background...')

      if (shell.exec(`sudo docker-compose up -d`).code !== 0) {
        reject(new Error('Can\'t start Docker in background.'))
      }
      // Adding 20sec timer for ES to get up and running
      // before starting restoration and migration processes
      setTimeout(() => { resolve() }, 20000)
    })
  }

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.