File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,13 +3,6 @@ FROM alpine:3.3
33# install common packages
44RUN apk add --update-cache curl bash openssl sudo && rm -rf /var/cache/apk/*
55
6- # install etcdctl and confd
7- RUN apk add --update-cache curl tar \
8- && curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.12.0-alpha3/confd-0.12.0-alpha3-linux-amd64 \
9- && chmod +x /usr/local/bin/confd \
10- && apk del --purge curl tar \
11- && rm -rf /var/cache/apk/*
12-
136# define execution environment
147CMD ["/app/bin/boot" ]
158EXPOSE 8000
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ echo system information:
1313echo " Django Version: $( ./manage.py --version) "
1414python --version
1515
16- # spawn confd in the background to update services based on changes
17- confd -backend env --confdir /app --log-level error --interval 5 &
18-
1916mkdir -p /app/data/logs
2017chmod -R 777 /app/data/logs
2118
2724fi
2825
2926echo " Django checks:"
30- python /app/manage.py check --deploy api
27+ python /app/manage.py check --settings deis.production -- deploy api
3128
3229echo " Health Checks:"
33- python /app/manage.py healthchecks
30+ python /app/manage.py healthchecks --settings deis.production
3431
3532echo " Database Migrations:"
36- sudo -E -u deis python /app/manage.py migrate --noinput
33+ sudo -E -u deis python /app/manage.py migrate --settings deis.production -- noinput
3734
3835# spawn a gunicorn server in the background
3936sudo -E -u deis gunicorn -c /app/deis/gconf.py deis.wsgi &
4037
41- python /app/manage.py load_db_state_to_k8s
38+ python /app/manage.py load_db_state_to_k8s --settings deis.production
4239
4340# smart shutdown on SIGTERM (SIGINT is handled by gunicorn)
4441function on_exit() {
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ adduser deis -D -h /app -s /bin/bash
3333# create a /app directory for storing application data
3434mkdir -p /app && chown -R deis:deis /app
3535
36- # create directory for confd templates
37- mkdir -p /templates && chown -R deis:deis /templates
36+ # create directory for configurations
37+ mkdir -p /configs && chown -R deis:deis /configs
3838
3939# install dependencies
4040pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import os
2+
13bind = '0.0.0.0'
24try :
3- workers = int ({{ if exists "/deis/controller/workers" }}{{ getv "/deis/controller/workers" }}{{ else }} " not set" {{ end }} )
5+ workers = int (os . environ . get ( 'GUNICORN_WORKERS' , ' not set' ) )
46 if workers < 1 :
57 raise ValueError ()
68except (NameError , ValueError ):
Original file line number Diff line number Diff line change 1- import os
2-
3- from .settings import *
1+ from deis .settings import * # noqa
42
53# security keys and auth tokens
64with open ('/var/run/secrets/api/builder/auth/builder-key' ) as f :
1614 DATABASES ['default' ]['PASSWORD' ] = f .read ().strip ()
1715
1816DATABASES ['default' ]['NAME' ] = DATABASES ['default' ]['USER' ]
19-
20- REGISTRATION_MODE = '{{ getv "/deis/controller/registration/mode" "enabled" }}'
21-
22- {{ if exists "/deis/controller/subdomain" }}
23- DEIS_RESERVED_NAMES = ['{{ getv "/deis/controller/subdomain" }}' ]
24- {{ end }}
Original file line number Diff line number Diff line change 250250TEMPDIR = tempfile .mkdtemp (prefix = 'deis' )
251251
252252# names which apps cannot reserve for routing
253- DEIS_RESERVED_NAMES = [' deis' ]
253+ DEIS_RESERVED_NAMES = [os . environ . get ( 'RESERVED_NAMES' , ' deis') ]
254254
255255# default scheduler settings
256256SCHEDULER_MODULE = 'scheduler'
276276LOGGER_PORT = os .environ .get ('DEIS_LOGGER_SERVICE_PORT_HTTP' , 80 )
277277
278278# check if we can register users with `deis register`
279- REGISTRATION_ENABLED = True
279+ REGISTRATION_MODE = os . environ . get ( 'REGISTRATION_MODE' , 'enabled' )
280280
281281DATABASES = {
282282 'default' : {
290290}
291291
292292APP_URL_REGEX = '[a-z0-9-]+'
293-
294- # Create a file named "local_settings.py" to contain sensitive settings data
295- # such as database configuration, admin email, or passwords and keys. It
296- # should also be used for any settings which differ between development
297- # and production.
298- # The local_settings.py file should *not* be checked in to version control.
299- try :
300- from .local_settings import * # noqa
301- except ImportError :
302- pass
You can’t perform that action at this time.
0 commit comments