blob: 1f5b7701e3044bd1e43b462351d079afae11f726 [file] [log] [blame]
Tony Mack44ad7052015-10-31 18:10:42 +00001#!/bin/bash
2
David K. Bainbridgeab4a2eb2015-12-03 11:49:01 -08003IMAGE_NAME=xosproject/xos
4CONTAINER_NAME=xos_build_helper_$$
Tony Mack44ad7052015-10-31 18:10:42 +00005DB_HOST=$(wget http://ipinfo.io/ip -qO -)
6
7# configure db host
Tony Mackc1a59d82015-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. Bainbridgeab4a2eb2015-12-03 11:49:01 -08009docker commit $CONTAINER_NAME $IMAGE_NAME
10docker rm $CONTAINER_NAME
Tony Mack44ad7052015-10-31 18:10:42 +000011
12# init db schema
Scott Baker0e1a0562016-01-14 09:38:34 -080013docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/tools/xos-manage makemigrations
Tony Mack502bb592015-11-01 16:28:54 +000014# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
Tony Mack12963cf2015-12-16 17:40:00 +000015docker commit --change="CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
David K. Bainbridgeab4a2eb2015-12-03 11:49:01 -080016docker rm $CONTAINER_NAME