Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the docker support for the installer #1843

Closed
pkarw opened this issue Oct 10, 2018 · 10 comments
Closed

Add the docker support for the installer #1843

pkarw opened this issue Oct 10, 2018 · 10 comments
Labels
feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can vs-hackathon Tasks for the Hackathon

Comments

@pkarw
Copy link
Collaborator

pkarw commented Oct 10, 2018

What is the motivation for adding / enhancing this feature?

We're able to run the Vue Storefront + Vue Storefront API solely using docker. No other requirements.
So, would be great to add the installer option to run it using docker - without the classical workflow.

To be honest, it's even simpler than current workflow. We just need to:

  • clone vue-storefront
  • run yarn install; yarn installer
  • installer will ask You for lot of things
  • in case of local vue-storefront-api - it still need to be cloned from the repo
  • we need to setup the configs
  • but then we're running just:

In the vue-storefront-api:
docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml up -d

In the vue-storefront:
docker-compose up -d

What are the acceptance criteria

  • There is a question in the installer "Would You like to start Vue Storefront using Docker either local Node instance? [default is the current behavior]"
  • The installer runs VS using docker or local node instance accordingly
@pkarw pkarw added the feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can label Oct 10, 2018
@Cyclonecode
Copy link
Collaborator

I can fix this.

@Cyclonecode
Copy link
Collaborator

Cyclonecode commented Oct 19, 2018

@pkarw - Looking at the installer right now it seems like we both are starting the docker container and running the dev environment using nohup npm run dev? Shouldn't docker-compose up -d only be called if we're not running the api using npm or am I missing something here?

        return this.backend.validateM2Integration()
          .then(this.backend.cloneRepository.bind(this.backend))
          .then(this.backend.goToDirectory.bind(this.backend))
          .then(this.backend.npmInstall.bind(this.backend))
          .then(this.backend.createConfig.bind(this.backend))
          .then(this.backend.dockerComposeUp.bind(this.backend)) <-- docker-compose up -d
          .then(this.backend.importElasticSearch.bind(this.backend))
          .then(this.backend.runDevEnvironment.bind(this.backend)) <-- nohup npm run dev

We also need to change the runDevEnvironment() for the frontend to something like:

  runDevEnvironment (answers) {
    return new Promise((resolve, reject) => {
      Message.info('Starting storefront server...')
      if (answers.run_using_docker) {
        if (shell.exec(`docker-compose up -d > /dev/null 2>&1`).code !== 0) {
          reject(new Error('Can\'t start docker in background.'))
        }
      } else {
        if (shell.exec(`nohup npm run dev >> ${Abstract.storefrontLogStream} 2>&1 &`).code !== 0) {
          reject(new Error('Can\'t start storefront server.', VUE_STOREFRONT_LOG_FILE))
        }
      }

      resolve(answers)
    })
  }

@pkarw
Copy link
Collaborator Author

pkarw commented Oct 22, 2018

Yes, You should run docker-compose up -d in the vue-storefront. In the vue-storefront-api - when local backend has been selected - You need to run

docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml up -d

Please note, that in case running the Dockerized app You need to modify the restore/migrate calls to:

docker exec -it vuestorefrontapi_app_1 yarn restore
docker exec -it vuestorefrontapi_app_1 yarn migrate

Details:
https://divanteltd.github.io/vue-storefront/guide/installation/linux-mac.html#install-the-vue-storefront-api

@pkarw pkarw added the vs-hackathon Tasks for the Hackathon label Oct 25, 2018
@pkarw
Copy link
Collaborator Author

pkarw commented Oct 25, 2018

@Cyclonecode how are things with this task ?Tomorrow's hackathon is a good moment to close it :)

@Cyclonecode
Copy link
Collaborator

@pkarw - Completely forgot about this one, but it seems like it has been already implemented so this ticket can now be closed =)

@pkarw
Copy link
Collaborator Author

pkarw commented Dec 3, 2018

@Cyclonecode it's not yet done - there is just docker started in "classical way" - I mean running just elasticsearch + redis in the api.

We need to modify it to have VS + VS API running 100% on Docker as a result.

@Cyclonecode
Copy link
Collaborator

@pkarw - Ah, I looked on the code and I understand. Ok, I will try to look on this during this week.

@ruthgeridema
Copy link
Contributor

@Cyclonecode , what is the status of this issue?

@hitchhooker
Copy link

Would be cool to see compatibility with podman as well.

@Cyclonecode
Copy link
Collaborator

I have had too much to do lately :) but will move this up in my todo list, actually I might look on this today. Let you know what is happening.

@pkarw pkarw closed this as completed Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can vs-hackathon Tasks for the Hackathon
Projects
None yet
Development

No branches or pull requests

5 participants