diff --git a/python-webapp2-vanilla/.gitignore b/python-webapp2-vanilla/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/python-webapp2-vanilla/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/python-webapp2-vanilla/Dockerfile b/python-webapp2-vanilla/Dockerfile new file mode 100644 index 0000000..26ad9c6 --- /dev/null +++ b/python-webapp2-vanilla/Dockerfile @@ -0,0 +1,11 @@ +FROM jin09/webapp2 + +MAINTAINER Gautam Jain + +RUN mkdir /home/src/ + +COPY /app /home/src/ + +RUN pip install -r /home/src/requirements.txt + +CMD ["python", "/home/src/main.py"] diff --git a/python-webapp2-vanilla/README.md b/python-webapp2-vanilla/README.md new file mode 100644 index 0000000..c271b63 --- /dev/null +++ b/python-webapp2-vanilla/README.md @@ -0,0 +1,5 @@ +# Webapp2 Without App Engine SDK + +## PORT + +Default Port for application is `8080`. diff --git a/python-webapp2-vanilla/app/docker-config.yaml b/python-webapp2-vanilla/app/docker-config.yaml new file mode 100644 index 0000000..a3580f0 --- /dev/null +++ b/python-webapp2-vanilla/app/docker-config.yaml @@ -0,0 +1,4 @@ +image: "python2.7-webapp2_vanilla:0.1" +port: 8080 +volume_mounts: null +env_variables: [] diff --git a/python-webapp2-vanilla/app/main.py b/python-webapp2-vanilla/app/main.py new file mode 100644 index 0000000..04faee5 --- /dev/null +++ b/python-webapp2-vanilla/app/main.py @@ -0,0 +1,16 @@ +import webapp2 + +class HelloWebapp2(webapp2.RequestHandler): + def get(self): + self.response.write('Hello, webapp2!') + +app = webapp2.WSGIApplication([ + ('/', HelloWebapp2), +], debug=True) + +def main(): + from paste import httpserver + httpserver.serve(app, host='0.0.0.0', port='8080') + +if __name__ == '__main__': + main() diff --git a/python-webapp2-vanilla/app/requirements.txt b/python-webapp2-vanilla/app/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/python-webapp2/.gitignore b/python-webapp2/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/python-webapp2/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/python-webapp2/Dockerfile b/python-webapp2/Dockerfile new file mode 100644 index 0000000..55d1c6f --- /dev/null +++ b/python-webapp2/Dockerfile @@ -0,0 +1,15 @@ +FROM jin09/app_engine + +MAINTAINER Gautam Jain + +RUN mkdir /home/src/ + +COPY /app /home/src/ + +# RUN ls -la /home/src/* + +# RUN rm -f /home/src/Dockerfile + +RUN pip install -r /home/src/requirements.txt + +CMD ["python", "/home/google_appengine/dev_appserver.py", "/home/src/app.yaml", "--skip_sdk_update_check=yes", "--host", "0.0.0.0", "--port", "8080"] diff --git a/python-webapp2/README.md b/python-webapp2/README.md new file mode 100644 index 0000000..e71d259 --- /dev/null +++ b/python-webapp2/README.md @@ -0,0 +1,7 @@ +# Webapp2 With App Engine SDK + +Developer can leverage the App Engine services as well eg. Datastore, Memcache etc. + +## PORT + +Default Port for application is `8080`. diff --git a/python-webapp2/app/app.yaml b/python-webapp2/app/app.yaml new file mode 100644 index 0000000..c6a6373 --- /dev/null +++ b/python-webapp2/app/app.yaml @@ -0,0 +1,17 @@ +application: python-webapp2 +version: 1 +runtime: python27 +api_version: 1 +threadsafe: yes + +handlers: +- url: /favicon\.ico + static_files: favicon.ico + upload: favicon\.ico + +- url: .* + script: main.app + +libraries: +- name: webapp2 + version: "2.5.2" diff --git a/python-webapp2/app/docker-config.yaml b/python-webapp2/app/docker-config.yaml new file mode 100644 index 0000000..e1abc04 --- /dev/null +++ b/python-webapp2/app/docker-config.yaml @@ -0,0 +1,4 @@ +image: "python2.7-webapp2:0.1" +port: 8080 +volume_mounts: null +env_variables: [] \ No newline at end of file diff --git a/python-webapp2/app/main.py b/python-webapp2/app/main.py new file mode 100644 index 0000000..65942b7 --- /dev/null +++ b/python-webapp2/app/main.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# +# Copyright 2007 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import webapp2 + + +class MainHandler(webapp2.RequestHandler): + def get(self): + self.response.write('Hello world!') + + +app = webapp2.WSGIApplication([ + ('/', MainHandler) +], debug=True) diff --git a/python-webapp2/app/requirements.txt b/python-webapp2/app/requirements.txt new file mode 100644 index 0000000..eb528cd --- /dev/null +++ b/python-webapp2/app/requirements.txt @@ -0,0 +1 @@ +webapp2