Friday, October 20, 2017

How to deploy automatically Laravel app with embedded Angular app to Heroku

I have a test app in GIT which has Laravel project and Angular SPA.

I have webpack, which builds the angular app and copies its files to /public/ folder of Laravel. To build angular, I run command npm run build

I have successfully deployed my laravel app to heroku but I am unable to deploy angular part correctly. I just need that during the deployment process on Heroku dyno it runs also a command like following

cd angular-app && npm run build

I have seen few tutorials and they talk about using nodejs server on Heroku. But I do not understand why I would need Node server on heroku when Nginx with Laravel will deliver all contents. I just need the angular app to be compiled.

Is there a way to run build commands on PHP, Nginx, Laravel dyno in Heroku?

Please help.

My Procfile (name of the file which Heroku uses) is

web: vendor/bin/heroku-php-nginx  public/

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/20/how-to-deploy-automatically-laravel-app-with-embedded-angular-app-to-heroku/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment