This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #2 from GoogleCloudPlatform/new-runtime

Updating dockerfile to use new runtime and updating app.yaml
  • Loading branch information...
waprin committed Nov 20, 2015
2 parents a04129c + 34a09c3 commit 1c6bb98fb9885f215602e8d44698d9aca0886f8e
Showing with 42 additions and 41 deletions.
  1. +25 −11 Dockerfile
  2. +16 −30 app.yaml
  3. +1 −0 requirements.txt
View
@@ -1,26 +1,40 @@
-# Copyright 2015, Google, Inc.
+# Copyright 2015 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
+# 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.
-#
-FROM google/python
+# limitations under the License
-RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates
+# The Google App Engine python runtime is Debian Jessie with Python installed
+# and various os-level packages to allow installation of popular Python
+# libraries. The source is on github at:
+# https://github.com/GoogleCloudPlatform/python-docker
+FROM gcr.io/google_appengine/python
-WORKDIR /app
+# Create a virtualenv for the application dependencies.
+# If you want to use Python 3, add the -p python3.4 flag.
RUN virtualenv /env
+
+# Set virtualenv environment variables. This is equivalent to running
+# source /env/bin/activate. This ensures the application is executed within
+# the context of the virtualenv and will have access to its dependencies.
+ENV VIRTUAL_ENV /env
+ENV PATH /env/bin:$PATH
+
+# Install dependencies.
ADD requirements.txt /app/requirements.txt
-RUN /env/bin/pip install -r /app/requirements.txt
+RUN pip install -r /app/requirements.txt
+
+# Add application code.
ADD . /app
-EXPOSE 8080
-CMD []
-ENTRYPOINT ["/env/bin/python", "manage.py", "runserver", "0.0.0.0:8080"]
+# Gunicorn is used to run the application on Google App Engine. $PORT is defined
+# by the runtime.
+CMD gunicorn -b :$PORT project.wsgi
View
@@ -1,33 +1,19 @@
-# This file specifies your Python application's runtime configuration
-# including URL routing, versions, static file uploads, etc. See
-# https://developers.google.com/appengine/docs/python/config/appconfig
-# for details.
+# Copyright 2015 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.
-# TODO: Enter your application id below. If you have signed up
-# using cloud.google.com/console use the "project id" for your application
-# id.
+# This file specifies your Python application's runtime configuration.
+# See https://cloud.google.com/appengine/docs/managed-vms/config for details.
runtime: custom
vm: true
-api_version: 1
-module: default
-
-resources:
- cpu: .5
- memory_gb: 1.3
- disk_size_gb: 10
-
-automatic_scaling:
- min_num_instances: 1
- max_num_instances: 5
- cool_down_period_sec: 60
- cpu_utilization:
- target_utilization: 0.5
-
-beta_settings:
- service_account_scopes: >
- https://www.googleapis.com/auth/userinfo.email,
- https://www.googleapis.com/auth/cloud-platform
-
-env_variables:
- PYTHON_ENV: production
- LOG_PATH: /var/log/app_engine/custom_logs
+entrypoint: custom
View
@@ -1 +1,2 @@
Django
+gunicorn

0 comments on commit 1c6bb98

Please sign in to comment.