blob: b90a570cf315cf3a38ef9c14b84f1e3b5f3c981f [file] [log] [blame]
A R Karthicke3bde962016-09-27 15:06:35 -07001#!/bin/bash
2
3IMAGE_NAME=xosproject/xos
4CONTAINER_NAME=xos_build_helper_$$
5DB_HOST=$(wget http://ipinfo.io/ip -qO -)
6
7# configure db host
8docker run -it --name=$CONTAINER_NAME $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_configuration/xos_common_config
9docker commit $CONTAINER_NAME $IMAGE_NAME
10docker rm $CONTAINER_NAME
11
12# init db schema
13docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/tools/xos-manage makemigrations
14# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
15docker commit --change="CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
16docker rm $CONTAINER_NAME