Python version check, docker-compose with nodeodm instance

pull/60/head
Piero Toffanin 2016-12-01 10:39:42 -05:00
rodzic 201888ebfc
commit cd1fdd48f4
3 zmienionych plików z 39 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,12 @@
# Chaining this file to the main docker-compose file adds
# a default processing node instance. This is best for users
# who are just getting started with WebODM.
services:
webapp:
entrypoint: /bin/bash -c "chmod +x /webodm/*.sh && /webodm/wait-for-it.sh db:5432 -- /webodm/start.sh --create-default-pnode"
node-odm-1:
image: pierotofy/nodeodm
container_name: node-odm-1
ports:
- "3000"

Wyświetl plik

@ -1,3 +1,5 @@
# This configuration does not include a processing node
# Which makes for faster setup times
version: '2'
services:
db:

Wyświetl plik

@ -1,4 +1,25 @@
#!/bin/bash
echo -e "\e[92m"
echo " _ __ __ ____ ____ __ ___"
echo "| | / /__ / /_ / __ \/ __ \/ |/ /"
echo "| | /| / / _ \/ __ \/ / / / / / / /|_/ / "
echo "| |/ |/ / __/ /_/ / /_/ / /_/ / / / / "
echo "|__/|__/\___/_.___/\____/_____/_/ /_/ "
echo
echo -e "\e[39m"
python -c "import sys;ret = 1 if sys.version_info <= (3, 0) else 0;print('Checking python version... ' + ('3.x, good!' if ret == 0 else '2.x'));sys.exit(ret);"
if [ $? -eq 1 ]; then
echo
echo "===================="
echo "You're almost there!"
echo "===================="
echo -e "\e[33mYour system is currently using Python 2.x. You need to install or configure your system to use Python 3.x. Check out http://docs.python-guide.org/en/latest/dev/virtualenvs/ for information on how to setup Python 3.x alongside your Python 2.x install.\e[39m"
echo
exit
fi
echo Building asssets...
webpack
@ -6,4 +27,8 @@ echo Running migrations
python manage.py makemigrations
python manage.py migrate
if [ $1 = "--create-default-pnode" ]; then
echo "from nodeodm.models import ProcessingNode; ProcessingNode.objects.update_or_create(hostname='node-odm-1', defaults={'hostname': 'node-odm-1', 'port': 3000})" | python manage.py shell
fi
python manage.py runserver 0.0.0.0:8000