ILIAS base docker images
- Even you use a proxy server you should use the ilias nginx image because it contains some dependencies which ILIAS needs (Like URL redirects or XAccel support)
- The install/update/migrate setup cli is auto be called on container (re)creation
- The config json is automatic generated
- Auto plugins setup are disabled because it's make problems with some plugins
- May additional manual config in ILIAS is automatic done
- Set/override root user password
- Create cron user / Override cron user password
- Enable/disable ILIAS development mode
- Enable/disable lucene search and lucene index cron job
- Set smtp server
- The external
data
directory andilias.ini.php
are symlinks to the internaldata
directory to combine both in one
Extends the ilias base image in a custom Dockerfile
and install ILIAS core with the wished version
FROM fluxfw/flux-ilias-ilias-base:php%php_version% AS ilias
RUN /flux-ilias-ilias-base/bin/install-ilias-core.sh %version%
You may wish to install other things like plugins or skins or apply some patches
RUN /flux-ilias-ilias-base/bin/install-archive.sh https://github.com/x/y/archive/z.tar.gz /var/www/html/Customizing/global/plugins/Services/X/Y/Z
If you have plugins and use ILIAS 8 you need to build Services/Component/artifacts/plugin_data.php
again to update the built plugin metadata - Unfortunately it seems ILIAS core has no seperate command for this and it needs to build the whole core again (The wole is unnecessary since you use the ILIAS core build archive ...)
RUN /flux-ilias-ilias-base/bin/run_ilias_build.sh
Extends the nginx base image too in the same Dockerfile
and copy your ILIAS code base from your ilias image
FROM fluxfw/flux-ilias-nginx-base:latest AS nginx
COPY --from=ilias /var/www/html /var/www/html
Currently, the follow versions are supported
- ILIAS 7 or 8
- PHP 7.4 or 8.0
You can build your custom images with
docker build . --pull --target ilias -t %image%/ilias:latest
docker build . --pull --target nginx -t %image%/nginx:latest
Create a docker-compose.yaml
for run the containers
You need to adjust placeholders and create secret files (Applies everywhere)
At first start you may need to adjust volume permissions, look in docker logs for get more informations
services:
database:
command: --character-set-server=utf8 --collation-server=utf8_general_ci
environment:
- MARIADB_DATABASE=ilias
- MARIADB_PASSWORD_FILE=/run/secrets/database_ilias_password
- MARIADB_ROOT_PASSWORD_FILE=/run/secrets/database_root_password
- MARIADB_USER=ilias
image: mariadb:latest
secrets:
- database_ilias_password
- database_root_password
volumes:
- ./data/mysql:/var/lib/mysql
ilias:
depends_on:
- database
environment:
- ILIAS_DATABASE_PASSWORD_FILE=/run/secrets/database_ilias_password
- ILIAS_HTTP_PATH=http[s]://%host%
- ILIAS_ROOT_USER_PASSWORD_FILE=/run/secrets/ilias_root_password
- ILIAS_SYSTEMFOLDER_CONTACT_FIRSTNAME=...
- ILIAS_SYSTEMFOLDER_CONTACT_LASTNAME=...
- ILIAS_SYSTEMFOLDER_CONTACT_EMAIL=...
image: %image%/ilias:latest
secrets:
- database_ilias_password
- ilias_root_password
volumes:
- ./data/ilias:/var/iliasdata
- ./data/log/ilias:/var/log/ilias
nginx:
depends_on:
- ilias
image: %image%/nginx:latest
ports:
- [%host_ip%:]80:80
volumes:
- ./data/ilias/web:/var/iliasdata/web:ro
secrets:
database_ilias_password:
file: ./data/secrets/database_ilias_password
database_root_password:
file: ./data/secrets/database_root_password
ilias_root_password:
file: ./data/secrets/ilias_root_password
services:
cron:
depends_on:
- ilias
entrypoint: /flux-ilias-ilias-base/bin/cron.sh
environment:
- ILIAS_CRON_USER_PASSWORD_FILE=/run/secrets/ilias_cron_password
- ILIAS_ROOT_USER_PASSWORD_FILE=/run/secrets/ilias_root_password
image: %image%/ilias:latest
init: true
secrets:
- ilias_cron_password
- ilias_root_password
volumes:
- ./data/ilias:/var/iliasdata
- ./data/log/ilias:/var/log/ilias
secrets:
ilias_cron_password:
file: ./data/secrets/ilias_cron_password
FROM fluxfw/flux-ilias-ilserver-base:java8 AS ilserver
COPY --from=ilias /var/www/html /var/www/html
docker build . --pull --target ilserver -t %image%/ilserver:latest
services:
ilias:
environment:
- ILIAS_LUCENE_SEARCH=true
ilserver:
depends_on:
- ilias
image: %image%/ilserver:latest
volumes:
- ./data/ilserver:/var/ilserverdata
- ./data/ilias:/var/iliasdata:ro
RUN /flux-ilias-ilias-base/bin/install-lessc.sh
services:
ilias:
environment:
- ILIAS_STYLE_MANAGE_SYSTEM_STYLES=true
RUN /flux-ilias-ilias-base/bin/install-wkhtmltopdf.sh
COPY --from=surnet/alpine-wkhtmltopdf:3.16.2-0.12.6-small /bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
RUN /flux-ilias-ilias-base/bin/install-apcu.sh
Note some containers needs that ilias
is already init before start it (If it isn't the case, you may end in endless restarts of the containers)
services:
database:
restart: always
ilias:
restart: always
nginx:
restart: always
[cron:
restart: always]
[ilserver:
restart: always]
If you don't use a proxy server, you can directly enable HTTPS on the containers with the follow config like
services:
nginx:
environment:
- ILIAS_NGINX_HTTPS_CERT=/run/secrets/https_cert
- ILIAS_NGINX_HTTPS_KEY=/run/secrets/https_key
[- ILIAS_NGINX_HTTPS_DHPARAM=/run/secrets/https_pem]
ports:
- [%host_ip%:]443:443
secrets:
- https_cert
- https_key
[- https_pem]
secrets:
https_cert:
file: ./data/certs/ilias.crt
https_key:
file: ./data/certs/ilias.key
[https_pem:
file: ./data/certs/ilias.pem]
Redirect HTTP to HTTPS is supported
Currently, for send emails only an external smtp server is supported
services:
ilias:
environment:
- ILIAS_SMTP_HOST=...
- ILIAS_SMTP_PORT=465
- ILIAS_SMTP_ENCRYPTION=tls
- ILIAS_SMPT_USER_FILE=/run/secrets/ilias_smtp_user
- ILIAS_SMTP_PASSWORD_FILE=/run/secrets/ilias_smtp_password
secret:
- ilias_smtp_user
- ilias_smtp_password
secrets:
ilias_smtp_user:
file: ./data/secrets/ilias_smtp_user
ilias_smtp_password:
file: ./data/secrets/ilias_smtp_password
services:
ilias:
environment:
- ILIAS_DEVMODE=true
services:
ilias:
environment:
- ILIAS_PHP_DISPLAY_ERRORS=On
If you wish to live apply code changes, you can mount the source code as a volume in the containers
services:
ilias:
volumes:
- ./ilias:/var/www/html
nginx:
volumes:
- ./ilias:/var/www/html:ro
[cron:
volumes:
- ./ilias:/var/www/html:ro]
[ilserver:
volumes:
- ./ilias:/var/www/html:ro]
[chatroom:
volumes:
- ./ilias:/var/www/html:ro]
As base, you can copy the source code from your ilias
image to your host
docker run --rm -it -u "`id -u`":"`id -g`" -v "$PWD":/tmp/host_data --entrypoint cp %image%/ilias:latest -r /var/www/html /tmp/host_data/ilias
May you need to update the ILIAS core composer dependencies, but if you don't wish to use composer on your host, you can use the follow config to automatic to this on the container (re)creation
services:
ilias:
environment:
- ILIAS_WEB_DIR_COMPOSER_AUTO_INSTALL=true
You can use a development SMTP server with the follow config
services:
ilias:
depends_on:
- smtp
environment:
- ILIAS_SMTP_HOST=smtp
- ILIAS_SMTP_PORT=1025
smtp:
image: mailhog/mailhog:latest
ports:
- [%host_ip%:]8025:8025
Not supported
You can find more information per image in