Skip to content

Commit 2615c04

Browse files
author
Bill Prin
committed
Basic Kinto Example
1 parent 493f850 commit 2615c04

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

managed_vms/kinto/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2015 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License
14+
15+
# The Google App Engine python runtime is Debian Jessie with Python installed
16+
# and various os-level packages to allow installation of popular Python
17+
# libraries. The source is on github at:
18+
# https://github.com/GoogleCloudPlatform/python-docker
19+
FROM gcr.io/google_appengine/python
20+
21+
# Create a virtualenv for the application dependencies.
22+
# If you want to use Python 3, add the -p python3.4 flag.
23+
RUN virtualenv /env
24+
25+
# Set virtualenv environment variables. This is equivalent to running
26+
# source /env/bin/activate. This ensures the application is executed within
27+
# the context of the virtualenv and will have access to its dependencies.
28+
ENV VIRTUAL_ENV /env
29+
ENV PATH /env/bin:$PATH
30+
ENV KINTO_INI /etc/kinto/kinto.ini
31+
32+
# Install dependencies.
33+
ADD requirements.txt /app/requirements.txt
34+
RUN pip install -r /app/requirements.txt
35+
RUN kinto --ini $KINTO_INI --backend=memory init && sed -i 's/8888/8080/g' $KINTO_INI
36+
37+
# Add application code.
38+
ADD . /app
39+
40+
# Use Gunicorn to serve the application.
41+
CMD kinto --ini $KINTO_INI migrate && kinto --ini $KINTO_INI start
42+

managed_vms/kinto/app.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2015 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This file specifies your Python application's runtime configuration.
16+
# See https://cloud.google.com/appengine/docs/managed-vms/config for details.
17+
18+
runtime: custom
19+
vm: true
20+
health_check:
21+
enable_health_check: False
22+
vm_health_check:
23+
enable_health_check: False
24+
25+
manual_scaling:
26+
instances: 1
27+
28+
# Temporary setting to keep gcloud from uploading the virtualenv
29+
skip_files:
30+
- ^v?env$

managed_vms/kinto/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gunicorn==19.4.5
2+
oauth2client==1.5.2
3+
kinto

0 commit comments

Comments
 (0)