saleor / saleor-platform

All Saleor services started from a single repository with docker-compose.
BSD 3-Clause "New" or "Revised" License
647 stars 889 forks source link

Add default environment variables to PWA #13

Open NyanKiyoshi opened 4 years ago

NyanKiyoshi commented 4 years ago

I received an email from somebody that was confused how to deploy the compose file as it would build with default environment variables, thus API_URL was set to localhost where in the case of that user, they needed it to point to a public IP address.

I suggest that we include those variables with the default values.

Those are (for dashboard):

Name Default
APP_MOUNT_URI http://localhost:9000/dashboard/
Adapt it for storefront, and check they have one.
API_URI http://localhost:8000/graphql/
STATIC_URL http://localhost:9000/
Please check it, not sure about it.

Otherwise, another solution, would be serving everything on the same port but with different path. Which is way easier, but we would need to add nginx for that in order to still be able to use npm start instead of npm run build.

tomaszszymanski129 commented 4 years ago

The compose file that is located here is strictly for development - we state that in readme not to confuse people:

Keep in mind this repository is for local development only and is not meant to be deployed on any production environment! If you're not a developer and just want to try out Saleor you can check our live demo.

So if anybody tries to actually deploy it using compose he's doing it against the purpose of this package. I agree the deployment docs we have are out of date and they should be changed, we might as well think of preparing a compose file ready for production, i've seen on gitter that a lot of people tries to run it on a remote server for whatever purpose and experience a lot of issues since this is against design.

NyanKiyoshi commented 4 years ago

Maybe one would want to be able to access it through an internal network without having to add a packet forwarding?

subhankarshah commented 4 years ago

@tomaszszymanski129 it would be great to have a docker-compose file for production and/or better documentation for production deployment, more power to you 👍 . also although i am not too familiar with the project let me know if i could contribute in some way