Viveckh / Veniqa

MEVN Full Stack E-Commerce Solution. Built using MEVN Stack (Node.js, Express.js, Vue.js, MongoDB) with Developer Friendliness and Cloud Integrations in mind. Previously Powered the Veniqa New York Startup. 100% Customizable. For Demos and Documentation, Visit Official Website

Home Page:https://www.veniqa.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying to Production

AmandaDLyon opened this issue · comments

commented

Describe the bug
I am not able to upload the site to a domain name. It does not load anything. How do I push this to a public server?

I am running the whole thing as a docker container and then I have NGINX installed on my server for reverse proxy.

@Viveckh @smaharj1

I am not quite sure what you are doing for your deployment. How you deploy totally depends on you. For web applications, you can use nginx or even S3 if you want since its just set of static files.

For server, you just need to run the servers and expose that port. If you want nginx, that is fine too. Just make sure that when you deploy, your servers run and domains are connected to correct ports.

commented

@smaharj1 So I have simply put all my code on a server and run docker-compose up then I installed NGINX and reverse proxy'd ports 5201 and 5202 to point to demo.com and admin.demo.com

I am not sure how to build for production. How do you deploy this to the internet?

I see that in management-webclient and in shopping-webclient, there is a file called vue.config.js in which there are paramenters called "host" and "port" and so on.

Could you please guide me on how to deploy this to a domain name? You can also share your nginx configuration file.

That will be of great help.

Thanks.

So ideally if you are deploying in prod, it might be a wise idea to decouple the components of the application and deploy them separately. The docker-compose one-command startup was put together for developers to quickstart, so it might not be entirely thought-through for production use.

For example - this is how we deploy our demo sites.

  • The web clients for shop.veniqa.com and admin.veniqa.com are deployed through Netlify as separate apps. The free tier has served us well to handle traffic for up to tens of thousands of visitors at certain peak times during Veniqa's history.

  • We have CD/CI integrations set up such that every merge on develop and master branches in our Github auto-triggers a fresh docker image build on Dockerhub for the server components. The dockerfiles living within each server codebase will come into use here.

  • The two servers are deployed as separate apps on Microsoft Azure. They pick up the individual docker images built on DockerHub above for the two servers. We only open access to our front end domains, so our servers decline requests from any other domain. The config files on our backends to enable this, so make sure to make use of that.


Correct me if I'm wrong on the following part @smaharj1

The vue.config.js files come in handy to point to the base URL to route the backend requests to. But I believe the .env files on the frontend are what is actually used now and these vue config files are actually deprecated.

@AmandaDLyon keep us posted about your progress, and if you don't mind post the link to your work when it goes to production!