I am running a Play application written in Java and running 2.11.1. It works fine locally and I successfully pushed it to Heroku a couple times. Since then, I have added a new controller and updated the routes with a couple of new actions.
It works fine locally but when deploying to Heroku, I get the following error (one for all the actions for this controller):
[error] /tmp/scala_buildpack_build_dir/conf/routes:12: object Dataset is not a member of package controllers
[error] GET /data controllers.Dataset.list()
I am using another controller that has been defined in the same fashion (only before) and it works fine. Extract from routes:
# Models page
GET /models controllers.PredictionModels.list()
# Data page
GET /data controllers.Dataset.list()
Is there a known problem on Heroku? Is it because I run Dev locally and Production on Heroku?
Related
I have created a MERN app and deployed it on Heroku But it works for a while and then gives Application error. However, the code is fine and on the localhost both the frontend and the backend with MongoDB work perfectly fine and are up and running. I have tried everything I found on the internet. Here's the list of things I've done:
Added the config vars on Heroku (in case someone thinks I forgot that)
Checked the Procfile whether there's any space error
Checked the package.json files and scripts
Tried to update the node_modules and restart Heroku
Made commits and tried to push on Heroku multiple times hoping it was a temporary error
But nothing seems to be working and it's still giving H10 errors. What can I try next?
I understand the process of local > staging > production deployment, although I've come across one issue which I have a solution, but it doesn't feel like it's the correct method.
I have a production .env on the server and a local .env for local development which is all fine for storing my environment variables. Although, I am using Stripe API and have testing API keys locally and live API keys for production.
My Stripe public key gets pulled into public.app.js the Vue/Inertia compilation using the MIX_ prefix in my .env. I first push this to GitHub and then Deploy this to Laravel Forge where in my deploy script it runs yarn prod, pulling in the live Stripe public API key once compiled by the server.
Basically, what I am asking is: Is there a standard deployment process where you compile production ready files locally pulling the correct API keys and push to GitHub, or is there a better way which removes the need of compiling assets on the server?
(I discovered Heroku yesterday)
I've deployed an App on Heroku, and it works just fine.
Problem is, my app saves some stuff inside .json files, so the deployed app contains new information.
How do I retrieve it?
I tried using heroku git but it just pulls the version at the moment of the deploy, non the one that has been changed at runtime.
I just created my first heroku app and pushed my code through it onto heroku. While testing it however, it showed that one of the templates didnot exist when it infact does when I test it from my laptop directly on the local server. Please do guide if you have any ideas!(ps.: I am using Windows hence please do keep take that into consideration when helping out!)
I have 2 repositories residing in Bitbucket - Backend (Laravel app as the API and entry point) and Frontend (Main application front-end - VueJs app). My goal is to set up continuous deployment so whenever something is pushed in either of the repos in master (or other branch selected by me) branch it triggers something so that the whole app builds and reaches the AWS EC2 server.
I have considered/tried the following:
AWS CodePipeline and/or CodeDeploy. This looked like a great option
since the servers are in AWS as well. However, there is no support
for Bitbucket out of the box, so it would have to go to Bitbucket
Pipeline -> AWS Lambda -> AWS S3 -> AWS CodePipeline/CodeDeploy ->
AWS EC2. This seems like a very lengthy journey and I am not sure if
that's a good practice whatsoever.
Using Laravel Forge to deploy the Laravel app, and add additional steps to build the VueJS app. This seemed like a very basic solution,
however, the build process seems to fail there as it just takes long
time and crashes with no errors (whereas I can run exact same process
on my local machine or a different server hosted elsewhere). I am not
sure if this is issue with the way server is provisioned, the way
Forge runs deployment script or the server is too weak to handle it.
The main question of mine would be what are the best pracises for deploying the app of such components? I have read many tutorials/articles about deploying a NodeJS app, or a Laravel app, but haven't gotten good information about a scenario like this.
Would it be better to build the front-end app locally and version control the built JS file? Or should I create a Pipeline in Bitbucket that would build the app and then deploy it? Or is it the best to just version control and deploy the source files and leave the whole build process as the last step in the deployment process that will be done by the server that is hosting the app itself? There are also some articles suggesting hosting the whole front-end app in S3 bucket - would that be bad practise as well?
Appreciate any help and resources that would help!
From the sounds of things it sounds like you have two types of deployments you might want to run.
Laravel API: If you're using Laravel Forge already then this is a great way to go about deploying your Laravel App, takes care of most of the process and easy server management.
Vue.js App: Few things you can do here, I personally prefer using a provider like Vercel or Netlify who let you deploy your static sites/frontends for free-low costs. You can write custom build steps but they have great presets that should work out the box.
If you really want to keep everything on AWS then look into how to host static sites on AWS