I've created a project to migrate from my heroku app to AWS Fargate.
But I couldn't find a solution for multi-module. Is there a way to do it?
In hereoku, there is a file like Procfile and we can easily set the different modules there.
https://devcenter.heroku.com/articles/procfile
web: java -jar web/target/myapp-1.0.0.jar
worker: java -jar worker/target/my-worker-app-1.0.0.jar
Actually I wonder that how can I handle procfile on AWS ECS?
Related
I have deployed my jar file to heroku using:
heroku deploy:jar <filename>.jar --app <appname>
Once deployed, how do I run the jar file with specific params, i.e. locally i would execute:
java -jar <filename>.jar <param1> <param2>
Am i using the Heroku service correctly? In essence I just need to run the Main command within the jar file and get the logs when completed.
Any help would be much appreciated.
heroku deploy:jar <filename>.jar --app <appname>
With this you essentially hardcorded:
jar <filename>.jar
Here is an example where you can configure parameters for your command
https://github.com/NNTin/shell-kun/tree/6b35e4b731bcf500366f60bbceafe076bf969fe1
Note: We are looking here at older software because HEAD no longer has it.
You need Procfile. app.json and the Heroku Deploy (see link in README.md) button are optional. They make deploying easier since you don't have to touch terminal/CLI.
Essentially you extend your Procfile to:
web: jar <filename>.jar $ARGS_AND_FLAGS
worker: jar <filename>.jar $ARGS_AND_FLAGS
web when you are utilizing a $PORT, worker when not.
Now you can modify your command by editing the environment variable ARGS_AND_FLAGS.
In this case the web process is activated and the worker process is deactivated.
After you changed your environment variable you can deactivate and then activate your process.
Create a Procfile in the same directory where you run heroku deploy:jar with the content:
web: java -jar <filename>.jar <param1> <param2>
and redeploy the app.
Now I am trying to deploy PlayApplication, but unfortunately my deploy failed. And the error code is H10, so probably I assume the problem is setting files because my database setting must be true as I can connect database by using the created username, password and URL.
And in my understanding, Procfile just shows a command to be run toward dynos and in tutorials, in terms of Java the procfile is like this:
web: java -jar target/helloworld.jar
However, in my application, the Procfile is web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -Dconfig.file=conf/application_prod.conf where conf/application_prod.conf is the path to the setting file. Is this Procfile right?
My play version is 2.2.1 and the official document says web: target/universal/stage/bin/retailos -Dhttp.port=${PORT} -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL} is good and I can also use the option -Dconfig.file= and then you can indicate where the setting file is. This means web: target/universal/stage/bin/retailos -Dhttp.port=${PORT} -DapplyEvolutions.default=trueBut -Dconfig.file=conf/application_prod.conf. But it does not work well.
And there are many candidates about the right way being also indicted by How to create play heroku procfile?.
I am really confused. I already have written all DB settings into application_prod.conf, so I prefer to use -Dconfig.file=.
What is exactly the true one?
Thanks.
Using -Dconfig.file and similar is definitely a good idea, you do not need to set all config parameters in your Procfile.
The reason it doesn't work is probably because you're using a file path for your config file, which to my knowledge doesn't work when the application is deployed as a jar. Try this instead:
-Dconfig.resource=application_prod.conf
I have my github source here https://github.com/pramadae/Monkey and deployed it on heroku. And https://immense-harbor-7247.herokuapp.com/ is my heroku app link. Unfortunately I could not run my application. Please help me.
You should change your Procfile to:
web: gunicorn run:app
I created a app for Angular manually, his structure and all stuff.
To run it locally I'm using http-server.
How can I deploy it to Heroku in order to inform what server to run (probably in Procfile)?
Create a Procfile just called Procfile (no extension) in the root of your app. Within that file use web: to tell heroku what to run. For example:
web: coffee server.coffee
I have seen very similar posts, that however did not help me to find a solution to my problem.
I am following step by step the guide to upload a project on heroku.
However when I type the command:
ps:scale web=1
The result is:
no such process type web defined in Procfile
I have created a file "Procfile" being careful at the capitalization. but nothing.
What else can I do to solve this problem??
Thanks in advance.
Follow on this heroku procfile
:
We have to define web process type in your Procfile and make sure name Procfile exactly, and not anything else. For example, Procfile.txt is not valid.
Example:
a: Python:
web: gunicorn gettingstarted.wsgi --log-file -
b: String MVC Hibernate
web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war
This declares a single process type, web, and the command needed to run it. The name web is important here. It declares that this process type will be attached to the HTTP routing stack of Heroku, and receive web traffic when deployed.
Procfiles can contain additional process types.
worker: bundle exec rake jobs:work
Hopefully you've fixed your problem after all this time, but just in case you haven't...
I've run into this problem when my Procfile doesn't exist (a web app that I'm porting to Heroku) or doesn't match the dyno type that I'm trying to deploy (see Heroku No such process type web defined in procfile for an example of that).
You've created your Procfile, but what did you put in there? For a website Node.js app, you'll need to put in:
web: node app.js
(Obviously you'll replace app.js with index.js or wherever your app starts)
For more about Procfiles (or for other languages than Node.js), see https://devcenter.heroku.com/articles/procfile