-
Notifications
You must be signed in to change notification settings - Fork 26
Adds git push template for python webapp2 with google_app_engine sdk #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
e22afee
fbba253
62bd68a
bc5b7b6
92881c3
749c18d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.pyc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| FROM jin09/app_engine | ||
|
|
||
| MAINTAINER Gautam Jain <[email protected]> | ||
|
|
||
| RUN mkdir /home/src/ | ||
|
|
||
| COPY / /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"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| image: "python2.7-webapp2:0.1" | ||
| port: 8080 | ||
| volume_mounts: null | ||
| env_variables: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| webapp2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.pyc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM jin09/webapp2 | ||
|
|
||
| MAINTAINER Gautam Jain <[email protected]> | ||
|
|
||
| RUN mkdir /home/src/ | ||
|
|
||
| COPY / /home/src/ | ||
|
|
||
| RUN rm -f /home/src/Dockerfile | ||
|
|
||
| RUN pip install -r /home/src/requirements.txt | ||
|
|
||
| CMD ["python", "/home/src/main.py"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with having an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, in the directory name of vanilla webapp2 use hyphens instead of underscore (as every other folder is hyphenated). So |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Webapp2 Without App Engine SDK | ||
|
|
||
| ## PORT | ||
|
|
||
| Default Port for application is `8080`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| image: "python2.7-webapp2_vanilla:0.1" | ||
| port: 8080 | ||
| volume_mounts: null | ||
| env_variables: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import webapp2 | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No it doesn't need webapp2 since it is already installed in the custom base Image that I have built for this (jin09/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() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create an
appdirectory instead of putting the source code in/home. That way it will be cleaner.