blob: b90a570cf315cf3a38ef9c14b84f1e3b5f3c981f [file] [log] [blame]
Tony Macka0340632015-10-31 18:10:42 +00001#!/bin/bash
2
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -08003IMAGE_NAME=xosproject/xos
4CONTAINER_NAME=xos_build_helper_$$
Tony Macka0340632015-10-31 18:10:42 +00005DB_HOST=$(wget http://ipinfo.io/ip -qO -)
6
7# configure db host
Tony Mack69c593c2015-12-16 17:09:13 +00008docker run -it --name=$CONTAINER_NAME $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_configuration/xos_common_config
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -08009docker commit $CONTAINER_NAME $IMAGE_NAME
10docker rm $CONTAINER_NAME
Tony Macka0340632015-10-31 18:10:42 +000011
12# init db schema
Scott Bakerdc90a242016-01-14 09:38:34 -080013docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/tools/xos-manage makemigrations
Tony Mackdaa25a62015-11-01 16:28:54 +000014# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
Zack Williamsb9f88212016-05-24 07:15:51 -070015docker commit --change="CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
David K. Bainbridge9c24cbf2015-12-03 11:49:01 -080016docker rm $CONTAINER_NAME