Tony Mack | a034063 | 2015-10-31 18:10:42 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
David K. Bainbridge | 9c24cbf | 2015-12-03 11:49:01 -0800 | [diff] [blame] | 3 | IMAGE_NAME=xosproject/xos |
| 4 | CONTAINER_NAME=xos_build_helper_$$ |
Tony Mack | a034063 | 2015-10-31 18:10:42 +0000 | [diff] [blame] | 5 | DB_HOST=$(wget http://ipinfo.io/ip -qO -) |
| 6 | |
| 7 | # configure db host |
Tony Mack | 69c593c | 2015-12-16 17:09:13 +0000 | [diff] [blame] | 8 | docker 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. Bainbridge | 9c24cbf | 2015-12-03 11:49:01 -0800 | [diff] [blame] | 9 | docker commit $CONTAINER_NAME $IMAGE_NAME |
| 10 | docker rm $CONTAINER_NAME |
Tony Mack | a034063 | 2015-10-31 18:10:42 +0000 | [diff] [blame] | 11 | |
| 12 | # init db schema |
Scott Baker | dc90a24 | 2016-01-14 09:38:34 -0800 | [diff] [blame] | 13 | docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/tools/xos-manage makemigrations |
Tony Mack | daa25a6 | 2015-11-01 16:28:54 +0000 | [diff] [blame] | 14 | # run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit" |
Zack Williams | b9f8821 | 2016-05-24 07:15:51 -0700 | [diff] [blame^] | 15 | docker commit --change="CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME |
David K. Bainbridge | 9c24cbf | 2015-12-03 11:49:01 -0800 | [diff] [blame] | 16 | docker rm $CONTAINER_NAME |