Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Dropwizard on Google AppEngine

I have been trying to find a way to deploy a Dropwizard app on Google AppEngine, but I haven't found anything so far.

Judging by this question (and answer) I think it might not be possible. I would like to be sure about that, and If it does work, I'd like to learn how.

There is a dropwizard fork called warwizard which apparently lets you create war files from your dropwizard code, but it has not been touched for over 6 months, which would likely make it difficult to work with using the dropwizard docs.

like image 200
derabbink Avatar asked Feb 28 '13 20:02

derabbink


2 Answers

Dropwizard is just Jersey+Jackson+Jetty bundled together nicely. Jetty and App Engine won't get along (that is, App Engine is already running Jetty, so it doesn't want the application to provide its own).

You're probably best off using Jersey and Jackson without Dropwizard tying them together: http://blog.iparissa.com/googles-app-engine-java/google-app-engine-jax-rs-jersey/ & http://www.cowtowncoder.com/blog/archives/2009/11/entry_338.html

like image 77
Michael Fairley Avatar answered Nov 07 '22 10:11

Michael Fairley


You can however, run Dropwizard on Google Compute Engine. Which is basically just linux VMs provided by Google, with access to their APIs if needed.

I manged to get my Dropwizard instance working by doing the following on GCE:

Install Java

sudo apt-get install java7-runtime-headless 

Open firewall ports:

gcutil addfirewall rest --description="http" --allowed="tcp:8080
gcutil addfirewall admin --description="admin" --allowed="tcp:8081"

Copy file to GCE

gcutil --project={project-id} push {instance-name} {local-file} {remote-target-path}

Run your app

java -jar your-app.jar server your-config.yml

EDIT: there is also another alternative called wiztowar https://github.com/twilio/wiztowar which supports DW 0.6.2 only.

like image 20
yunspace Avatar answered Nov 07 '22 10:11

yunspace