blob: 1f5b7701e3044bd1e43b462351d079afae11f726 [file] [log] [blame]
Pingping Linb7a7d2b2016-08-19 18:11:36 +00001#!/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 update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
16docker rm $CONTAINER_NAME