vue-storefront-api icon indicating copy to clipboard operation
vue-storefront-api copied to clipboard

Improved Docker Setup

Open tonyisworking opened this issue 4 years ago • 3 comments

Similar improvment from the vsf-app pr #4102

Add to docker-compose.nodejs-alt.yml and docker/vue-storefront-api-alt as alternative non breaking docker setups.

Short Description and Why It's Useful

  • Be in line with the docker way,
  • separate out the kue worker and api start commands into their own services via environment variable API_MODE with options for api and o2m and falls back to yarn start, in the docker/vue-storefront-api-alt/vue-storefront-api.sh
  • Build source inside the image instead
  • Use docker to cache builds for faster startups
  • Scale via containers instead of pm2 and ecosystem.json
  • add docker healthcheck script to check localhost:8080/api if api is still running
  • add nginx and sample nginx.conf to proxy to the api containers
  • use node directly on startup for production use

Should be able to do something like docker-compose -f docker-compose.yml -f docker-compose.nodejs-alt.yml up --build --scale api-alt=6 --scale worker=3 if using docker-compose.

tonyisworking avatar Feb 29 '20 00:02 tonyisworking

Cool; thanks! Great job. @tonyisworking maybe you’ve already seen our other project storefront-api? How about including this docker files there as well (if so please do use the “develop” branch). In the Storefornt-api case I guess we could name this file rather like “-prod” marking its desired for production setups (and the default one is for the development purposes)

@kkdg maybe we should include this alternate option in the docs?

pkarw avatar Feb 29 '20 05:02 pkarw

Here’s the link: https://github.com/DivanteLtd/storefront-api

pkarw avatar Feb 29 '20 05:02 pkarw

@pkarw Seems like a fork of the vuestorefront-api? ..From quickly skimming the repository, it seems similar enough to copy over... I'll open a PR

tonyisworking avatar Mar 02 '20 20:03 tonyisworking