When using VSF with docker network_mode: host is not supported for Docker for Desktop(Mac). Thus the categories and products cannot be fetched using SSR.
Pick one option.
develop branch and create Pull Request 2. Feature / Improvement back to develop.release branch and create Pull Request 3. Stabilisation fix back to release.hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.
I was able to run VSF in docker without network_mode: host using:
environment:
NODE_TLS_REJECT_UNAUTHORIZED: 0
All the endpoints should be just provided with _ssr option.
example:
"api": {
"url": "http://publicdomain.com:80",
"url_ssr": "http://privateaddress:8080",
},
"cart": {
"create_endpoint": "/api/cart/create?token={{token}}",
"create_endpoint_ssr": "/api/cart/create?token={{token}}",
"updateitem_endpoint": "/api/cart/update?token={{token}}&cartId={{cartId}}",
"updateitem_endpoint_ssr": "/api/cart/update?token={{token}}&cartId={{cartId}}",
"deleteitem_endpoint": "/api/cart/delete?token={{token}}&cartId={{cartId}}",
"deleteitem_endpoint_ssr": "/api/cart/delete?token={{token}}&cartId={{cartId}}"
}
Please make sure the following areas are updated:
vue-storefront-api project,core/scripts/installer.jsquickSearchByQuery - basically the search adapters in the vue-storefront,sync/task.tsThen double-check if all the endpoints specified in the config were supported:
redis.host
graphql.host
api.url
elasticsearch.host
storeViews.elasticsearch.host
cart.create_endpoint
cart.updateitem_endpoint
cart.deleteitem_endpoint
cart.pull_endpoint
cart.totals_endpoint
cart.paymentmethods_endpoint
cart.shippingmethods_endpoint
cart.shippinginfo_endpoint
cart.collecttotals_endpoint
cart.deletecoupon_endpoint
cart.applycoupon_endpoint
products.endpoint
orders.endpoint
reviews.create_endpoint
users.endpoint
users.history_endpoint
users.resetPassword_endpoint
users.changePassword_endpoint
users.login_endpoint
users.create_endpoint
users.me_endpoint
users.refresh_endpoint
stock.endpoint
mailer.endpoint.send
mailer.endpoint.token
Thanks @pkarw!! This change will improve VSF performance on a Kubernetes setup.
@AdrianBalcan yeah, as soon as anyone weill implement it :D
@andrzejewsky we've just got another user inquiry regarding this issue Today (Slack) and I belive we should take care of it in the next feature release
Most helpful comment
All the endpoints should be just provided with
_ssroption.example:
Please make sure the following areas are updated:
vue-storefront-apiproject,core/scripts/installer.jsquickSearchByQuery- basically the search adapters in thevue-storefront,sync/task.tsThen double-check if all the endpoints specified in the config were supported: