github.com/chasestarr/deis@v1.13.5-0.20170519182049-1d9e59fbdbfc/controller/build.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # fail on any command exiting non-zero
     4  set -eo pipefail
     5  
     6  if [[ -z $DOCKER_BUILD ]]; then
     7    echo
     8    echo "Note: this script is intended for use by the Dockerfile and not as a way to build the controller locally"
     9    echo
    10    exit 1
    11  fi
    12  
    13  # install required system packages
    14  apk add --no-cache \
    15    build-base \
    16    libffi-dev \
    17    libpq \
    18    openldap \
    19    openldap-dev \
    20    openssl \
    21    postgresql-dev \
    22    python \
    23    python-dev
    24  
    25  # install pip
    26  curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1
    27  
    28  # add a deis user
    29  adduser deis -D -h /app -s /bin/bash
    30  
    31  # create a /app directory for storing application data
    32  mkdir -p /app && chown -R deis:deis /app
    33  
    34  # create directory for confd templates
    35  mkdir -p /templates && chown -R deis:deis /templates
    36  
    37  # install dependencies
    38  pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
    39  
    40  # cleanup.
    41  apk del --no-cache \
    42    build-base \
    43    libffi-dev \
    44    openldap-dev \
    45    postgresql-dev \
    46    python-dev