Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
ddd601b
allow overriding the lizmap_version
mbernasocchi Jan 9, 2019
942a522
fix typo
mbernasocchi Jan 9, 2019
0192507
fix typo
mbernasocchi Jan 9, 2019
4754b26
Add sqlite3 package
marioba Feb 25, 2019
351ba74
use opengisch fork
mbernasocchi Mar 15, 2019
f8cd033
Merge branch 'master' of github.com:opengisch/docker-lizmap
mbernasocchi Mar 15, 2019
e18f86a
add psql and nano
mbernasocchi Jun 20, 2019
c182e72
Migrated to ubuntu 18.04 and php7.2-fpm and using proxy_fcgi module
mbernasocchi Jun 20, 2019
a5df610
clean up conf
mbernasocchi Jun 20, 2019
3c99786
Remove ugly base URL
mbernasocchi Jun 21, 2019
af87db7
more clean up
mbernasocchi Jun 21, 2019
4b83001
move setup to docker file
mbernasocchi Jun 21, 2019
6015412
clean up but ctrl+c is not working
mbernasocchi Jun 21, 2019
6ad3d75
all cleaned up. docker compose works. added demo project
mbernasocchi Jun 22, 2019
3da441f
use qgis server 3.8 with default config
mbernasocchi Jun 23, 2019
f2aea47
change gpkg PRAGMA to delete to allow mounting in read only
mbernasocchi Jun 25, 2019
1ebf172
use ubuntu images to solve statx problem
mbernasocchi Jun 30, 2019
325ea64
Merge branch 'master' of github.com:opengisch/docker-lizmap
mbernasocchi Jun 30, 2019
cc093f5
Set apache directory index for documents
marioba Jul 8, 2019
6a478f8
Require referer to allow documents directory
marioba Aug 5, 2019
5bda277
update versions
mbernasocchi Sep 18, 2019
0ab57c9
use explicit network
mbernasocchi Sep 18, 2019
a77d859
fix version numbering
mbernasocchi Sep 18, 2019
98584b0
Include letsencrypt (#1)
mbernasocchi Sep 19, 2019
1359fd5
disable certbot
mbernasocchi Sep 19, 2019
1582144
cleanup
mbernasocchi Sep 19, 2019
91d5c60
enable certbot only on first run
mbernasocchi Sep 19, 2019
6a44b03
use certbot staging by default
mbernasocchi Sep 19, 2019
7875826
add crontab to auto renew
mbernasocchi Sep 19, 2019
85746fb
reuse marioba pg image
mbernasocchi Sep 19, 2019
04d2d07
fix text file busy
mbernasocchi Oct 31, 2019
3f718fc
allow disabling letsencrypt
mbernasocchi Dec 10, 2019
b3438e8
Merge branch 'master' into doc_links
mbernasocchi Dec 10, 2019
a953434
stay closer to master
mbernasocchi Dec 10, 2019
287df62
Merge branch 'doc_links' of https://github.com/opengisch/docker-lizma…
mbernasocchi Dec 10, 2019
b28d77e
typo
mbernasocchi Dec 10, 2019
07357a3
Merge pull request #3 from opengisch/doc_links
mbernasocchi Dec 10, 2019
215f9a8
optimise installation order. Will also trigger a no-cache build
mbernasocchi Dec 10, 2019
8fafdde
update qgis server to 3.10.1
sbaeji Jan 16, 2020
476699a
update qgis and lizmap to 3.10.6 and 3.3.6
mbernasocchi Jun 26, 2020
d495a22
downgrade qgis to last avail docker
mbernasocchi Jun 26, 2020
f1cfa5f
Revert "downgrade qgis to last avail docker"
mbernasocchi Jun 26, 2020
a0e58d3
update qgis to 3.10.7
mbernasocchi Jun 26, 2020
209399a
enable cron on start
mbernasocchi Sep 23, 2020
f5aeae8
add ldap
mbernasocchi Oct 23, 2020
ac32621
clean up temp before php install, because of this https://github.com/…
signedav Oct 24, 2020
cbdbdd3
Update docker-compose.yml
mbernasocchi Feb 4, 2021
79c9ede
commands to reload ldap config done in the configuration files
signedav Feb 4, 2021
b9a4e7d
add WITH_LDAP arg
mbernasocchi Feb 4, 2021
5e62f60
consider WITH_LDAP
signedav Feb 4, 2021
786daec
Merge pull request #4 from opengisch/ldap
mbernasocchi Feb 4, 2021
afcd39a
Update README.md
mbernasocchi Feb 4, 2021
eceb799
Update Dockerfile
mbernasocchi Feb 4, 2021
f4ed1b2
Update README.md
mbernasocchi Feb 4, 2021
c442e6d
fix path in entrypoint
mbernasocchi Aug 10, 2021
925c242
Revert to version 3.3.11
m-kuhn Aug 17, 2021
0fbb4e5
Merge pull request #6 from opengisch/3_3_11
m-kuhn Aug 17, 2021
9b0db56
Only published
m-kuhn Aug 17, 2021
a23cb07
Update workflow
m-kuhn Aug 17, 2021
72badd3
set lizmap to version 3.5.1, use qgis server to 3.22 in compose for t…
vvmruder Feb 22, 2022
fb206cb
Merge pull request #7 from opengisch/bump_qgis_lizmap
vvmruder Feb 22, 2022
e45166a
setup version 3.4.9 for usage with docker
vvmruder Mar 11, 2022
2383b9b
Merge pull request #8 from opengisch/v3.4.9
vvmruder Mar 11, 2022
6cb8d5d
bumpp to new version
vvmruder Apr 29, 2022
bfa830a
Merge pull request #9 from opengisch/provide_version_3_5_1
vvmruder Apr 29, 2022
6f0b8f7
fix php deps
vvmruder May 18, 2022
387ab3e
Merge pull request #10 from opengisch/fix_version_3_5_3
vvmruder May 18, 2022
dfd5222
fix version
vvmruder May 18, 2022
af90b2e
Merge pull request #11 from opengisch/fix_v353
vvmruder May 18, 2022
bc2c4f1
add saml support
vvmruder Sep 14, 2023
6ae4a3b
allow superuser
vvmruder Sep 14, 2023
c4ba0e5
fix entrypoint
vvmruder Sep 14, 2023
e2464dc
fix apache module
vvmruder Sep 14, 2023
6f9a13b
Fix the build and the startup of the image
laurentj Oct 20, 2023
1f8a5c9
Add a process to upgrade from a previous version of lizmap
laurentj Oct 20, 2023
a3276a8
Fix: launch the configurator alone to do migration if any
laurentj Oct 24, 2023
af5f481
Merge pull request #12 from laurentj/fix-launch
vvmruder Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 🧪 Release

on:
release:
types: ['published']


jobs:
build:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
name: Extract tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: opengisch/lizmap:${{ env.RELEASE_VERSION }}
133 changes: 117 additions & 16 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,23 +1,124 @@
FROM ubuntu:22.04
LABEL opengisch.image.authors=="Clemens Rudert"

FROM debian:jessie
MAINTAINER Julien Ancelin / docker-lizmap
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get -y update \
&& apt-get -t jessie install -y python-simplejson python-software-properties xauth htop vim curl ntp ntpdate ssl-cert\
apache2 apache2-mpm-worker apache2-mpm-prefork apache2-bin apache2-data libapache2-mod-fcgid libapache2-mod-php5 \
php5 php5-common php5-cgi php5-curl php5-cli php5-sqlite php5-gd php5-pgsql unzip\
&& apt-get clean \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y universe
# && add-apt-repository ppa:ondrej/php

RUN apt-get -y update \
&& apt-get install -y --fix-missing \
python3-simplejson \
xauth \
htop \
nano \
curl \
ntp \
ntpdate \
ssl-cert \
openssl \
software-properties-common \
apache2 libapache2-mod-fcgid \
php-fpm \
php \
php-curl \
php-cli \
php-pdo \
php-pgsql \
php-sqlite3 \
php-gd \
php-xmlrpc \
php-xml \
php-ldap\
php-date \
# php-zlib \
sqlite3 \
postgresql-client \
cron certbot python3-certbot-apache \
unzip \
rsync \
zlib1g

RUN apt-get clean \
&& rm -r /var/lib/apt/lists/*

RUN a2dismod php5; a2enmod actions; a2enmod fcgid ; a2enmod ssl; a2enmod rewrite; a2enmod headers; \
a2enmod deflate; a2enmod php5

ENV LIZMAPVERSION master
COPY files/ /home/files/
# Get php composer
RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php && \
HASH=`curl -sS https://composer.github.io/installer.sig` && \
echo $HASH && \
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer

ARG LE_domain="example.com"
ARG LE_email="info@example.com"
ARG LE_staging='true'
ARG LE_on='false'

ENV LE_domain=$LE_domain
ENV LE_email=$LE_email
ENV LE_staging=$LE_staging
ENV LE_on=$LE_on

# this can be overriden at build time with --build-arg lizmap_version=release_3_2
ARG lizmap_version=3.6.7
ENV LIZMAPVERSION=$lizmap_version

# setup apache modules
RUN a2dismod mpm_prefork mpm_event; \
a2enmod actions alias ssl rewrite headers deflate mpm_worker; \
a2enmod fcgid proxy_fcgi;

# copy config
COPY conf/apache2.conf /etc/apache2/
COPY conf/mod_deflate.conf /etc/apache2/conf-available/
COPY conf/fcgid.conf /etc/apache2/mods-enabled/
COPY conf/default-ssl.conf /etc/apache2/sites-available/
COPY conf/000-default.conf /etc/apache2/sites-available/

ADD https://github.com/3liz/lizmap-web-client/archive/$LIZMAPVERSION.zip /var/www/
RUN /home/files/setup.sh

VOLUME ["/var/www/websig/lizmap/var" , "/home"]
# enable self signed SSL
RUN mkdir /etc/apache2/ssl
RUN make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem
RUN a2ensite default-ssl

# install lizmap
RUN echo "Downloading https://github.com/3liz/lizmap-web-client/releases/download/$LIZMAPVERSION/lizmap-web-client-$LIZMAPVERSION.zip"
RUN mkdir -p /var/www/ \
&& curl -SL https://github.com/3liz/lizmap-web-client/releases/download/$LIZMAPVERSION/lizmap-web-client-$LIZMAPVERSION.zip > lizmap-web-client-$LIZMAPVERSION.zip && \
unzip -q lizmap-web-client-$LIZMAPVERSION.zip && \
rsync -a lizmap-web-client-$LIZMAPVERSION/* /var/www && \
rm -rf lizmap-web-client-$LIZMAPVERSION && \
rm -rf lizmap-web-client-$LIZMAPVERSION.zip
# set default configuration
RUN cp /var/www/lizmap/var/config/profiles.ini.php.dist /var/www/lizmap/var/config/profiles.ini.php
COPY conf/lizmapConfig.ini.php /var/www/lizmap/var/config/
COPY conf/localconfig.ini.php /var/www/lizmap/var/config/

# backup default var folder, it will be copied by docker-entrypoints.sh into /var/www/lizmap/var at first start,
# if the directory is empty
RUN mv /var/www/lizmap/var var/www/lizmap/var_install

# use default composer.json and install the extra modules
RUN cp /var/www/lizmap/my-packages/composer.json.dist /var/www/lizmap/my-packages/composer.json
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer require --working-dir=/var/www/lizmap/my-packages "jelix/saml-module"

RUN mkdir -p /io/data/

VOLUME ["/var/www/lizmap/var" , "/io"]
EXPOSE 80 443
CMD /start.sh

# Add crontab file in the cron directory
ADD conf/crontab /etc/cron.d/cache-cron
# Give execution rights on the cron job
RUN chmod 0644 /etc/cron.d/cache-cron
# Apply cron job
RUN crontab /etc/cron.d/cache-cron
# Create the log file to be able to run tail
RUN touch /var/log/cron.log


COPY conf/docker-entrypoint.sh /usr/local/bin/
#RUN chmod u+x /bin/docker-entrypoint.sh
CMD ["docker-entrypoint.sh"]
53 changes: 44 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
docker-lizmap
=============

![docker_lizmap](https://cloud.githubusercontent.com/assets/6421175/25778701/68e9a536-3306-11e7-9196-84247b04eb92.png)
__________________________________________________________________

LizMap est une solution complète de publication de cartes QGIS sur Internet.

LizMap is a complete Internet QGIS map publishing.
___________________________________________________________________________

____________________________________________________________________
Building image:
---------------
docker build --build-arg lizmap_version=3.6.7 -t=opengisch/lizmap:3.6.7 .

Using image:
---------------

With Docker-compose:

* Create a docker-compose.yml and changing the directory path if necessary (home/lizmap/lizmap_project):

https://github.com/jancelin/docker-lizmap/blob/master/docker-compose.yml
https://github.com/opengisch/docker-lizmap/blob/master/docker-compose.yml

* UP

Expand All @@ -27,18 +28,52 @@ docker-compose up -d
* Now config lizmap on web :

```
http://ip/websig/lizmap/www/admin.php/config
http://localhost/admin.php/config
```
* change URL WMS:

>> http://qgiserver/cgi-bin/qgis_mapserv.fcgi

* Add **/home/** for looking your geo projects
* Add **/io/qgis/** for looking your geo projects

![config](https://cloud.githubusercontent.com/assets/6421175/11306233/e945f342-8fb0-11e5-9906-4010b9398ef1.png)

* http://docs.3liz.com/fr/

Upgrading from Lizmap 3.5
-------------------------

If you want to reuse a database containing tables of Lizmap 3.5, create a directory somewhere,
for example `./lizmap-previous-config`, and copy these files into it:

- at least the `installer.ini.php` of the Lizmap 3.5 installation (stored originally into `lizmap/var/config`)
- the `lizmapConfig.ini.php` file if you want to retrieve the list of projects
- the `profiles.ini.php` file if there are specific connection profiles
- the `localconfig.ini.php` and `liveconfig.ini.php` if you want to retrieve some specific configuration, but
you should remove from them any reference to modules that are not used anymore into your new lizmap container.
- if you are using a sqlite database, the `jauth.db` database file (stored originally into `lizmap/var/db`)

Modify the `docker-compose.yml` file to mount the `./lizmap-previous-config` directory at `/var/www/lizmap/previous-config`
for the lizmap image. For example:

```
services:
lizmap:
...
volumes:
- ./projects:/io/data:ro
- var:/var/www/lizmap/var
- ./lizmap-previous-config/:/var/www/lizmap/previous-config
```

Launch docker compose. It will install the `installer.ini.php` and the `jauth.db`, and other configuration files if
there are present, and then it will launch the Lizmap installer which will migrate data if needed.

Stop the containers and remove the mount on `/var/www/lizmap/previous-config`, else it will overwrite new data
at the next start, with the old database and old configuration files.



-------------------------------

Lizmap Web Application generates dynamically a web map application (php/html/css/js) with the help of Qgis Server ( QGIS Server Tutorial ). You can configure one web map per Qgis project with the QGIS LizMap Plugin.
Expand Down
18 changes: 11 additions & 7 deletions files/apache.conf → conf/000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www
DocumentRoot /var/www/lizmap/www

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
Expand All @@ -27,13 +27,17 @@
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
Options ExecCGI FollowSymLinks
Require all granted
AddHandler fcgid-script .fcgi
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
Options ExecCGI FollowSymLinks
Require all granted
AddHandler fcgid-script .fcgi
</Directory>

<FilesMatch \.php$>
# 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php8.1-fpm.sock|fcgi://localhost/"
</FilesMatch>
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
File renamed without changes.
1 change: 1 addition & 0 deletions conf/crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0 */12 * * * certbot renew >/dev/null 2>&1
File renamed without changes.
83 changes: 83 additions & 0 deletions conf/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/bash
set -e
#generate config file
VARCONFIG="/var/www/lizmap/var/config"
PREVIOUSCONFIG="/var/www/lizmap/previous-config"

echo "LE_on:" $LE_on
echo "LE_staging:" $LE_staging
echo "LE_email:" $LE_email
echo "LE_domain:" $LE_domain

if [[ ! -d $VARCONFIG ]]; then
# the var volume is empty, let's fill it with default configuration files and missing directories
echo "Creating Config file in /var"
cp -avr /var/www/lizmap/var_install/* /var/www/lizmap/var
fi

if [[ -d $PREVIOUSCONFIG ]]; then
# there is a volume containing the installer.ini.php file and the jauth.db file of
# a previous version of Lizmap, let's install it.
if [[ -f $PREVIOUSCONFIG/installer.ini.php ]]; then
cp $PREVIOUSCONFIG/installer.ini.php $VARCONFIG/
fi
if [[ -f $PREVIOUSCONFIG/localconfig.ini.php ]]; then
cp $PREVIOUSCONFIG/localconfig.ini.php $VARCONFIG/
fi
if [[ -f $PREVIOUSCONFIG/liveconfig.ini.php ]]; then
cp $PREVIOUSCONFIG/liveconfig.ini.php $VARCONFIG/
fi
if [[ -f $PREVIOUSCONFIG/profiles.ini.php ]]; then
cp $PREVIOUSCONFIG/profiles.ini.php $VARCONFIG/
fi
if [[ -f $PREVIOUSCONFIG/lizmapConfig.ini.php ]]; then
cp $PREVIOUSCONFIG/lizmapConfig.ini.php $VARCONFIG/
fi
if [[ -f $PREVIOUSCONFIG/jauth.db ]]; then
cp $PREVIOUSCONFIG/jauth.db /var/www/lizmap/var/db/
fi
fi

# Apache gets grumpy about PID files pre-existing
rm -f /run/apache2/apache2.pid

service php8.1-fpm start

if [[ $LE_on == 'true' ]]; then

if [[ $LE_staging == 'true' ]]; then
echo "LE will use staging certificate"
STAGING='--test-cert'
fi
LE_CONF=/etc/apache2/sites-enabled/000-default-le-ssl.conf
if [[ ! -f "$LE_CONF" ]]; then
/usr/sbin/apachectl start
echo "LE need to create conf files. Issuing:"
set -x
certbot --non-interactive --apache --redirect --agree-tos --domains $LE_domain --email $LE_email $STAGING
set +x
/usr/sbin/apachectl stop
sleep 5
fi
fi

# launch the configurator. In case this is an upgrade of Lizmap, it will
# launch the migration of configuration file if needed
php /var/www/lizmap/install/configurator.php

# activate extra modules
php /var/www/lizmap/install/configurator.php saml
php /var/www/lizmap/install/configurator.php samladmin

# launch the installer, it will launch modules/lizmap installers if
# lizmap/var was empty or it will launch module updaters if needed..
php /var/www/lizmap/install/installer.php

# remove cache and temporary files, to be sure that they will be regenerated
# with the updated configuration and source files
/var/www/lizmap/install/clean_vartmp.sh
#set-rights
/var/www/lizmap/install/set_rights.sh www-data www-data

cron
exec /usr/sbin/apachectl -DFOREGROUND
6 changes: 3 additions & 3 deletions files/fcgid.conf → conf/fcgid.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

# this file will overwrite default file: /etc/apache2/mods-available/fcgid.conf

<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
<IfModule mod_mime.c>
AddHandler fcgid-script .fcgi
</IfModule>
FcgidConnectTimeout 300
FcgidIOTimeout 300
FcgidMaxProcessesPerClass 50
Expand All @@ -12,5 +13,4 @@
BusyTimeout 300
FcgidInitialEnv QGIS_AUTH_DB_DIR_PATH /tmp/auth/db/
FcgidInitialEnv QGIS_AUTH_PASSWORD_FILE /tmp/auth/master/qgis_auth_master_password.txt

</IfModule>
File renamed without changes.
Loading