|
| 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 | + |
0 commit comments