Deploying play application to production

154 views
Skip to first unread message

Joshnet

unread,
Mar 12, 2011, 6:09:42 AM3/12/11
to play-framework

Hi there.

I have developed a small application based on play framework (am still
learning). Now i need to bundle it for shipping. One way is to create
a war file and deploy it in a servlet container such as tomcat- That
is very clear from the docs. The other option is to use the built in
http server. This is what i want to do since it is the recommended
way. Now how do i pull off the application from my development
application so that i can deploy it into the production server - I
mean how do i compile and produce a bundle that can be distributed to
my client who will do something like unzip the distribution parkage
and run a script to start the server?

Or i put it this way, do i need to set play path on my production
server , then copy my project files to the production server so that
my user can run it using play run, as i have been doing in my
development environment?

The docs only say that i change to production mode.

Morten Kjetland

unread,
Mar 13, 2011, 5:03:01 PM3/13/11
to play-fr...@googlegroups.com
If you modify your application.conf to contain "application.mode=prod", then you could just zip the your app folder.
Then you have to install play (with needed modules) on your prod server. then unzip the zipfile, and run your app with "play start"..

The code would be compiled automatically when it starts.

That should be it i think..

-Morten


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Josh Kamau

unread,
Mar 13, 2011, 11:20:51 PM3/13/11
to play-fr...@googlegroups.com
Thanks Morten,

But i dont want to distribute my source code. I wish there was a way of bundling play as a runtime enviroment, separate from the development environment. I wonder if am the only one who has this deployment need.

Josh.

Ivan San José García

unread,
Mar 14, 2011, 3:08:54 AM3/14/11
to play-fr...@googlegroups.com
You can precompile Java classes with ./play precompile application

Once you do this, you can remove all .java files. Note that views
sources are required!!

Later you can run your application with: ./play start application
-Dprecompiled=true

2011/3/14 Josh Kamau <joshn...@gmail.com>:

Josh Kamau

unread,
Mar 14, 2011, 3:56:18 AM3/14/11
to play-fr...@googlegroups.com
Thanks . That helped.

Any specific problem with deploying as a war file?

Josh.

2011/3/14 Ivan San José García <iva...@gmail.com>

Marcus Downing

unread,
Mar 15, 2011, 4:44:57 AM3/15/11
to play-fr...@googlegroups.com
Deploying as a war file makes your server dependant on the server you use: Tomcat, Glassfish etc. Play then has less control over things like threading, so it won't perform as well under load.

Also, it feels ugly. :)
Reply all
Reply to author
Forward
0 new messages