PaaS Deployment


You can deploy to a PaaS in Codenvy using the native tools provided by the PaaS providers (SDK and CLI). You will have to create a custom environment with a chosen SDK or CLI provided by your PaaS vendor. The resulting Dockerfile can vary depending on the complexity of the installation process and setting up environment. Below are examples of creating custom environment where you can deploy your Java apps to Google App Engine and AppFog.

Google App Engine

To deploy your application to Google App Engine (GAE) or other PaaS, you can use a custom runner environment that has the relevant SDK pre-installed.

Below is an example of a custom Dockerfile that creates an environment with the Google App Engine SDK installed, unpacks the .war file and launches a dev server:

FROM codenvy/jdk7
RUN mkdir /home/user/app /home/user/sdk
RUN wget -P /home/user/ --quiet
RUN unzip /home/user/ -d /home/user && cp -r /home/user/appengine-java-sdk-1.9.10/* /home/user/sdk && \
    rm -r /home/user/ /home/user/appengine-java-sdk-1.9.10/
WORKDIR /home/user/sdk/bin/
ADD $app$ /home/user/app/
RUN sudo chown -R user:user /home/user/app/WEB-INF/  
CMD ./ -a /home/user/app

After you run this and when you are happy with the application and want to deploy it to GAE, go to Terminal tab and perform the following:

cd /home/user/sdk/bin
./ update /home/user/app

You will be prompted to enter your Google ID and password. It will be necessary to specify the application ID in the appengine-web.xml file.

If you have Docker installed locally on your machine, you can build an image and upload it to DockerHub. It will take a while to pull the image the first time, but later environment boot times will be much faster due to caching. If you choose to do so, your custom Dockerfile will look like:

FROM yourName/yourImage
ADD $app$ /home/user/app/
RUN sudo chown -R user:user /home/user/app/WEB-INF/

The same approach can be used for Python and PHP applications using the relevant SDK (some commands may need to be altered to match the SDK in use).

Visit the Google App Engine docs for more details and complete commands reference.


AppFog offers a CLI client to manage apps and account. The CLI is installed as a Ruby gem, so you will need an environment with Ruby:

FROM codenvy/ruby210
RUN sudo apt-get -y install rubygems
RUN sudo gem install af
ADD $app$ /home/user/$app$
RUN sudo chown -R user:user /home/user
CMD while true;do true; done

Go to a Terminal, login to your AppFog account, and create/update your applications using AppFog CLI commands. See: AppFog CLI Commands Reference.

Similar to Google App Engine, you can build own image with AppFog CLI, upload it to Docker Index and use it as a base image in your custom Dockerfile.