blob: 1f5b7701e3044bd1e43b462351d079afae11f726 [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"
Tony Mack80ed9e82015-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. Bainbridge9c24cbf2015-12-03 11:49:01 -080016docker rm $CONTAINER_NAME