Skip to content

Instantly share code, notes, and snippets.

@bhachauk
Created May 31, 2021 17:14
Show Gist options
  • Save bhachauk/9103166c431f1d69788b6f79f8c7274c to your computer and use it in GitHub Desktop.
Save bhachauk/9103166c431f1d69788b6f79f8c7274c to your computer and use it in GitHub Desktop.
FROM debian:buster-slim
ENV LANG=en_EN.UTF-8
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests --allow-unauthenticated -y \
gnupg \
ca-certificates \
wget \
locales \
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
# Add the current key for package downloading - As the key changes every year at least
# Please refer to QGIS install documentation and replace it with the latest one
&& wget -O - https://qgis.org/downloads/qgis-2020.gpg.key | gpg --import \
&& gpg --export --armor F7E06F06199EF2F2 | apt-key add - \
&& echo "deb http://qgis.org/debian buster main" >> /etc/apt/sources.list.d/qgis.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests --allow-unauthenticated -y \
qgis-server \
spawn-fcgi \
xauth \
xvfb \
&& apt-get remove --purge -y \
gnupg \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m qgis
ENV TINI_VERSION v0.17.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENV QGIS_PREFIX_PATH /usr
ENV QGIS_SERVER_LOG_STDERR 1
ENV QGIS_SERVER_LOG_LEVEL 2
COPY cmd.sh /home/qgis/cmd.sh
RUN chmod -R 777 /home/qgis/cmd.sh
RUN chown qgis:qgis /home/qgis/cmd.sh
USER qgis
WORKDIR /home/qgis
ENTRYPOINT ["/tini", "--"]
CMD ["/home/qgis/cmd.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment