iteconomics/limesurvey

By iteconomics

Updated about 1 month ago

LimeSurvey is the lightweight tool, it-economics uses for surveys – provided by this container.

Image

10K+

LimeSurvey – Extension of Apache Base Image

Provisioned by it economics GmbH

Docker images provided within this repository are built on the needs of it economics GmbH.

The LimeSurvey Image is based on our base Apache with current PHP version 7.2.

How to get this container run

Minimal usage is to provide at least mandatory environmental variables from next chapter – so base usage can look like this [given that there is a Docker container databasecontainer within the Docker network internal and the given user credentials]:

docker run \
   --rm -d -P \
   --network internal \
   -e DB_HOST=databasecontainer \
   -e DB_NAME=database \
   -e DB_USER=user \
   -e DB_PASS=password \
   -e LIMESURVEY_ADMIN=admin \
   -e LIMESURVEY_ADMIN_PASS='$uper-secur3' \
   -e LIMESURVEY_ADMIN_NAME=Admin \
   -e LIMESURVEY_ADMIN_MAIL='admin@example.net' \
   -e LIMESURVEY_SHOW_SCRIPT_NAME=true \
   iteconomics/limesurvey:latest

Environmental Variables

This image is customizable by these environmental variables:

envdefaultmandatorychange recommendeddescriptioncomment
RUNTIMEFOLDER/var/www/limesurveynonofolder LimeSurvey puts the runtime files like sessions in
DB_USERyesyesdatabase user
DB_PASSyesyespassword for database user $DB_USER
DB_NAME$DB_USERnoyesdatabase the user $DB_USER will work on for LimeSurvey
DB_HOSTyesyeshost of database $DB_NAME
DB_PREFIX"lime_"nonoprefix for all LimeSurvey-Tables within database
LIMESURVEY_ADMINyesyesusername for LimeSurvey super admin
LIMESURVEY_ADMIN_PASSyesyespassword for super admin $LIMESURVEY_ADMIN
LIMESURVEY_ADMIN_NAMEyesyesreal name for super admin $LIMESURVEY_ADMIN
LIMESURVEY_ADMIN_MAILyesyese-mail address for super admin $LIMESURVEY_ADMIN
LIMESURVEY_DEFAULT_LANGnoyesabbreviation of default language to useLimeSurvey defaults to en
LIMESURVEY_TITLEnoyesTitle of LimeSurvey instancedefaults to LimeSurvey
ADMIN_THEME_NAMEnoyestheme name for admin theme to be activated
DEFAULT_TEMPLATEnoyestheme name for survey themehas to be installed through the admin interface before it can be activated through this setting since there are done complex parsing steps during installation of a theme
LDAP_SERVERnoyesldap servermandatory for activating ldap configuration; every LDAP variable without default has to be defined – else installation will fail
LDAP_PORT389noyesport for ldap connection
LDAP_VERSION3nonoldap version to use
LDAP_TLS0no0 or 1 – whether TLS should not or should be activated
LDAP_SEARCH_USER_ATTRIBUTEuidnosearch attribute for users
LDAP_USER_PREFIX''noset userprefix for ldap binds
LDAP_USER_SUFFIX''noset usersuffix for ldap binds
LDAP_USER_SEARCH_BASEou=people,dc=example,dc=comnoyesldap search base
LDAP_BIND_DNcn=admin,dc=example,dc=comnoyesldap user / authority to check binds
LDAP_BIND_PASSnoyespassword for ldap user / authority $LDAP_BIND_DN
LDAP_MAIL_ATTRIBUTEmailnoldap attribute for logged in users to be fetched as mail attribute to LimeSurvey
LDAP_FULLNAME_ATTRIBUTEdisplayNamenoldap attribute interpreted as fullname for logged in users in LimeSurvey
LDAP_IS_DEFAULT1noyes1 or 0 – whether ldap login should or not be default login method
LDAP_AUTOCREATE1noyes1 or 0 – whether login through ldap should create LimeSurvey user
LDAP_ALLOW_CREATION_TO_LOGGEDIN''noyes
LDAP_GROUP_SEARCH_BASEou=groups,dc=example,dc=comnoyesin which searchbase LimeSurvey should search for groups?
LDAP_GROUP_NAMElimesurveynoyesgroup name an user should belong to for a successful login to LimeSurvey

From Apache image it got these environmental variables for further usage:

envdefaultmandatorychange recommendeddescriptioncomment
PHP_TIMEZONE"Europe/Berlin"noyestimezone-file to use as default – can be one value selected out of /usr/share/zoneinfo/, i.e. <region>/<city>
APACHE_WORKDIR/var/www/htmlnonohome folder of apache web applicationinstallation directory for auto installation of LimeSurvey during build process of the image
APACHE_LOG_DIR/var/log/apache2noyesfolder for log files of apache
APACHE_PUBLIC_DIR$APACHE_WORKDIRnoyesfolder used within apache configuration to be published – can be usefull if i.e. subfolder public of webproject should be exposed
PHP_XDEBUG0noyesYou can use this to enable xdebug. start-apache2 script will enable xdebug if PHP_XDEBUG is set to 1
YESWWWfalsenoyesDuplicate content has to be avoided – therefore a decision for containers delivering content of www.domain.tld and domain.tld has to be made which one should be the mainly used one. YESWWW will be overridden by NOWWW if both are true.
NOWWWfalsenoyesSee YESWWW
HTTPStruenoyesrelevant for YESWWW and NOWWW since config rules have to be adjusted.
SMTP_HOSTnoyesshould be set to your smtp host, i.e. mail.example.com
SMTP_PORTnoyesdefaults to 587
SMTP_FROMnoyesshould be set to your sending from address, i.e. motiontool@example.com
SMTP_USERnoyesdefaults to SMTP_FROM and has to be the user, you are authenticating on the SMTP_HOST
SMTP_PASSnoyesshould be set to your plaintext(!) smtp password, i.e. I'am very Secr3t!
WORKINGUSERwww-datanonouser that works as apache user – not implemented changable
TERMxtermnonoset terminal type – default xterm provides 16 colors
DEBIAN_FRONTENDnoninteractivenonoset frontent to use – default self-explaining

Installed Tools

tool(s)description
software-properties-common, procpssimplify further installations
python-setuptools, python-pip, python-pkg-resourcessimplify python installations
python-jinja2, j2cliused for template provisioning
python-yaml, python-paramikoprovision Image for further provisioning via Ansible
vim, nanoeditors
python-httplib2Small, fast HTTP client library for Python
python-keyczarToolkit for safe and simple cryptography
htop, tree, tmux, screen, sudo, git, zsh, ssh, screenusefull ops tools – oh-my-zsh is installed further
supervisorprocess manager that allows to manage long-running programs
gnupg, opensslencryption tools
curl, wgetfetch remote content
mysql-client, libpq-dev, postgresql-client, sqlite3, libsqlite3-devinstall database things – except of SQLite3 no real database is installed since full databases should run at least on a separate container
libkrb5-dev, libc-client-devdevtools especially for email
zlib1g-devcompression library
libfreetype6-dev, libjpeg62-turbo-dev, libmcrypt-dev, libpng-devsimplify working with and on images
nodejsjavascript development tools
composerphp package manager
msmtp, msmtp-mtasimple and easy to use SMTP client replacing sendmail

PHP Libraries installed

imap, pdo, pdo_mysql, imap, zip, gd, exif, mcrypt

PHP Modules enabled

rewrite

Files to be aware of

/templates/apache.j2 – the Apache Config

The apache config used within containers of this image. It will be provisioned at every start of the container – so you should consider to mount a new template instead of mounting a default apache config directly.

Full Template

<VirtualHost *:80>

    ServerAdmin root
    DocumentRoot {{ APACHE_PUBLIC_DIR | default(APACHE_WORKDIR) }}

    <Directory {{ APACHE_PUBLIC_DIR | default(APACHE_WORKDIR) }}/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

    AccessFileName .htaccess
	<FilesMatch "^\.ht">
		Require all denied
	</FilesMatch>

    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
	LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
	LogFormat "%h %l %u %t \"%r\" %>s %O" common
	LogFormat "%{Referer}i -> %U" referer
	LogFormat "%{User-agent}i" agent

    CustomLog /proc/self/fd/1 combined

    <FilesMatch \.php$>
		SetHandler application/x-httpd-php
	</FilesMatch>

    ErrorLog {{ APACHE_LOG_DIR }}/error.log
    CustomLog {{ APACHE_LOG_DIR }}/access.log combined

    # Multiple DirectoryIndex directives within the same context will add
	# to the list of resources to look for rather than replace
	# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
	DirectoryIndex disabled
	DirectoryIndex index.php index.html

</VirtualHost>

Docker Pull Command

docker pull iteconomics/limesurvey