diff --git a/README.md b/README.md index 6e4806ac..6742a9cf 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ ## Usage -Expects a `project.qgs` project file and all the files it depends on in the `/project/` +Expects a `project.qgs` project file and all the files it depends on in the `/etc/qgisserver/` directory. Either you create another image to add those files or you inject them using a volume. For example: ```bash -docker run -d -p 8380:80 --volume=$PWD/project:/project camptocamp/qgis-server +docker run -d -p 8380:80 --volume=$PWD/etc/qgisserver:/etc/qgisserver camptocamp/qgis-server ``` With the previous command, you'll get to your server with this URL: http://localhost:8380/?SERVICE=WMS&REQUEST=GetCapabilities @@ -20,8 +20,8 @@ You can use the following variables (`-e` option in `docker run`): * QGIS_SERVER_LOG_LEVEL: The debug level for the logs (0=max debug, 3=no debug logs) * QGIS_SERVER_LOG_FILE: To output the logs to a file (default to stdout) -* PGSERVICEFILE: If you want to change the default of `/project/pg_service.conf` -* QGIS_PROJECT_FILE: If you want to change the default of `/project/project.qgs` +* PGSERVICEFILE: If you want to change the default of `/etc/qgisserver/pg_service.conf` +* QGIS_PROJECT_FILE: If you want to change the default of `/etc/qgisserver/project.qgs` * MAX_REQUESTS_PER_PROCESS: The number of requests a QGIS server will serve before being restarted by apache * QGIS_CATCH_SEGV: Set to "1" if you want stacktraces in the logs in case of segmentation faults. diff --git a/server/Dockerfile b/server/Dockerfile index 0fb252dd..e7e4a3b6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -40,13 +40,15 @@ RUN a2enmod fcgid headers && \ mkdir -p /var/www/plugins && \ chown www-data: /var/www/.qgis3 && \ mknod /var/log/docker p && \ - chown www-data: /var/log/docker + chown www-data: /var/log/docker && \ + ln --symbolic /project /etc/qgisserver + # A few tunable variables for QGIS ENV QGIS_SERVER_LOG_LEVEL=0 \ QGIS_SERVER_LOG_FILE=/var/log/docker \ - PGSERVICEFILE=/project/pg_service.conf \ - QGIS_PROJECT_FILE=/project/project.qgs \ + PGSERVICEFILE=/etc/qgisserver/pg_service.conf \ + QGIS_PROJECT_FILE=/etc/qgisserver/project.qgs \ MAX_CACHE_LAYERS="" \ QGIS_PLUGINPATH=/var/www/plugins \ MAX_REQUESTS_PER_PROCESS=1000 @@ -56,5 +58,6 @@ COPY target /usr/local/ RUN ldconfig +WORKDIR /etc/qgisserver EXPOSE 80 CMD ["/bin/bash", "/usr/local/bin/start-server.sh"]