...
 
Commits (2)
......@@ -13,7 +13,7 @@ WORKDIR /app
RUN pip install --upgrade pip
RUN apk update && \
apk add bash \
apk add bash git openssh \
${lib_packages} \
${dev_packages} && \
pip install gunicorn \
......
......@@ -22,6 +22,27 @@ else
cd /app
fi
#
# Clone a git repo if configured
#
if [[ -n "${FIRST_RUN}" && "${GIT_REPO_URL}" ]]
then
if [[ -z "${GIT_SSH_KEY_FILE}" ]]
then
GIT_SSH_KEY_FILE=/Git_SSH_Key
fi
if [[ ! -s "${GIT_SSH_KEY_FILE}" && -n "${GIT_SSH_KEY}" ]]
then
echo ${GIT_SSH_KEY} > ${GIT_SSH_KEY_FILE}
chmod 600 ${GIT_SSH_KEY_FILE}
fi
if [[ -s ${GIT_SSH_KEY_FILE} ]]
then
export GIT_SSH_COMMAND="ssh -i ${GIT_SSH_KEY_FILE} -o PasswordAuthentication=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
fi
git clone ${GIT_REPO_URL} .
fi
if [[ -n "${FIRST_RUN}" && -n "${REQUIRED_PACKAGES}" ]]
then
apk update
......