Fix things
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ services:
|
||||
web:
|
||||
build: .
|
||||
image: 86.50.143.82:5000/web20
|
||||
command: ["bash", "-c", "./.wait-for-it.sh db:5432 -- bash setup.py --no-input"]
|
||||
command: ["bash", "-c", "cd /code && ./wait-for-it.sh db:5432 -- bash setup.sh --no-input --no-npm && python manage.py runserver 0.0.0.0:8080"]
|
||||
volumes:
|
||||
- .:/code
|
||||
ports:
|
||||
|
||||
@@ -6,10 +6,17 @@ echo "========================================================="
|
||||
echo "Dependencies: postgresql>9.5, python>3.5"
|
||||
|
||||
INTERACTIVE="true"
|
||||
USE_NPM="true"
|
||||
if [[ $* == *--no-input* ]]
|
||||
then
|
||||
INTERACTIVE="false"
|
||||
fi
|
||||
if [[ $* == *--no-npm* ]]
|
||||
then
|
||||
USE_NPM="false"
|
||||
fi
|
||||
|
||||
$INTERACTIVE || echo "Running in non-interactive mode." && env
|
||||
|
||||
$INTERACTIVE && read -p "Are these programs installed? [y/n]" -n 1 -r || REPLY="y"
|
||||
echo ""
|
||||
@@ -56,11 +63,13 @@ then
|
||||
fi
|
||||
|
||||
set -e
|
||||
(set -x; pip install -r requirements.txt)
|
||||
(set -x; npm install)
|
||||
(set -x; python manage.py migrate)
|
||||
(set -x; python manage.py createdefaultadmin)
|
||||
set -x
|
||||
pip install -r requirements.txt
|
||||
$USE_NPM && npm install
|
||||
python manage.py migrate
|
||||
python manage.py createdefaultadmin
|
||||
set +e
|
||||
set +x
|
||||
|
||||
echo "Done."
|
||||
echo "Run 'python manage.py runserver 0.0.0.0:8000' to start the development server!"
|
||||
|
||||
@@ -19,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
IS_DOCKER = bool(os.getenv('IS_DOCKER', None))
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
|
||||
@@ -106,6 +107,7 @@ WSGI_APPLICATION = 'sikweb.wsgi.application'
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
|
||||
|
||||
if not IS_DOCKER:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
@@ -119,7 +121,18 @@ DATABASES = {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
else:
|
||||
logging.info('Using docker database configuration')
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'postgres',
|
||||
'USER': 'postgres',
|
||||
'PASSWORD': 'postgres',
|
||||
'HOST': 'db',
|
||||
'PORT': '5432',
|
||||
},
|
||||
}
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
|
||||
|
||||
|
||||
Reference in New Issue
Block a user