blob: bd020c5cfaba3f5f5240163f4ffd0f2a46d2d8dd [file] [log] [blame]
Tony Mack44ad7052015-10-31 18:10:42 +00001#!/bin/bash
2
3IMAGE_NAME=xos
4DB_HOST=$(wget http://ipinfo.io/ip -qO -)
5
6# configure db host
7docker run -it $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_config
8CONTAINER_ID=$(docker ps -a | grep $IMAGE_NAME | head -1 | awk '{print $1}')
9echo $CONTAINER_ID $IMAGE_NAME
10docker commit $CONTAINER_ID $IMAGE_NAME
11
12# init db schema
13docker run -it $IMAGE_NAME /opt/xos/scripts/opencloud makemigrations
14CONTAINER_ID=$(docker ps -a | grep $IMAGE_NAME | head -1 | awk '{print $1}')
Tony Mack502bb592015-11-01 16:28:54 +000015# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
Tony Mack37028c72015-11-01 16:27:21 +000016docker commit --change "CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_ID $IMAGE_NAME