From 8ba9dd812ebb112d60dedaeee76ead3d4de5eaec Mon Sep 17 00:00:00 2001 From: David Schmitz <schmitz@lrz.de> Date: Fri, 10 May 2019 15:36:22 +0200 Subject: [PATCH] docker: updated Dockerfile, run script, settings.dist for docker --- Dockerfile | 1 + flowspy/settings.py.dist | 3 ++- runfod.sh | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7e69320..cb2c87fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM debian:stable RUN apt-get -yqq update RUN apt-get -yqq install virtualenv python python-dev vim git gcc libevent-dev libxml2-dev libxslt-dev patch beanstalkd mariadb-server libmariadb-dev libmariadbclient-dev-compat sqlite3 +RUN apt-get -yqq install procps # RUN echo "create database fod;" | mysql -u root diff --git a/flowspy/settings.py.dist b/flowspy/settings.py.dist index 4a592251..4d533337 100644 --- a/flowspy/settings.py.dist +++ b/flowspy/settings.py.dist @@ -66,7 +66,8 @@ DATABASES = { # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # In a Windows environment this must be set to your system time zone. -TIME_ZONE = 'Europe/Athens' +#TIME_ZONE = 'Europe/Athens' +TIME_ZONE = 'UTC' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html diff --git a/runfod.sh b/runfod.sh index 4fe676d7..6b12fb18 100755 --- a/runfod.sh +++ b/runfod.sh @@ -3,6 +3,15 @@ export LC_ALL="C" # this will unfortunatelly break ./manage.py createsuperuser as locale string is literally used to derive encoding . /srv/venv/bin/activate +if [ ! -e /srv/flowspy/pythonenv ]; then + cat > /srv/flowspy/pythonenv <<EOF +#!/bin/bash +. /srv/venv/bin/activate +exec "\$@" +EOF + chmod +x /srv/flowspy/pythonenv +fi + ## # fix needed to make sure gevent works # may be put into Dockerfile instead @@ -20,8 +29,10 @@ cd "$(dirname "$0")" echo "Starting services FoD is depending on generically: beanstalkd" 1>&2 service beanstalkd start -echo "Starting DB services FoD might be depending on (depending on its config): mysql" 1>&2 -service mysql start +if [ ! -x ./fodcli_db_is_mysql ] || ./fodcli_db_is_mysql; then + echo "Starting DB services FoD might be depending on (depending on its config): mysql" 1>&2 + service mysql start +fi # hook to initiallize (without any user interaction admin user and its peer data) [ -x ./fodcli_insert_basic_data.sh ] && ./fodcli_insert_basic_data.sh -- GitLab