Compare commits

...

16 Commits

Author SHA1 Message Date
Markus Opolka
bdcab55309 Upgrading to Version 5.0.4+210614 2021-06-22 07:53:53 +02:00
Markus Opolka
2755985321 Upgrading to LTS Version 3.27.3+210615 2021-06-22 07:46:01 +02:00
Jack Henschel
cb5b062980 Minor workflow fixes (#70)
* YAML indentation
* Correct image labels
2021-06-21 19:38:58 +02:00
Jack Henschel
3890f9f73a Build and push images with Github Actions to DockerHub (#68)
* Build and push images with Github Actions to DockerHub
* Remove Travis CI configuration

References:
* https://docs.github.com/en/actions/guides/publishing-docker-images
* https://github.com/docker/build-push-action/blob/master/docs/advanced/tags-labels.md
* https://github.com/docker/metadata-action

Note: docker / buildx does not support '+' in the image tag name.
> invalid tag "martialblog/limesurvey:0.0.0+test5-apache": invalid
reference format

Use underscores instead, like the images already have on Dockerhub.

Co-authored-by: Markus Opolka <markus.opolka@iis.fraunhofer.de>
2021-06-21 13:27:58 +02:00
Markus Opolka
c181f3a832 Upgrading to Version 5.0.3+210609 2021-06-15 08:13:04 +02:00
Markus Opolka
eda09e735e Upgrading to LTS Version 3.27.2+210608 2021-06-15 08:12:10 +02:00
Markus Opolka
80a5f95fab Upgrading to Version 5.0.2+210607 2021-06-09 07:44:57 +02:00
Nimrod Zimerman
65c1902247 Fix Apache LISTEN_PORT "sed" command to look for whole "Listen" command (#64)
Otherwise, if the replaced port number contains "80" (for example, "8080",
as is now the default), it is replaced over and over on each activation
2021-06-08 09:56:17 +02:00
Markus Opolka
387fcf11f4 Upgrading to Version 5.0.1+210532 2021-06-07 16:46:51 +02:00
Markus Opolka
3ffdb0d003 Upgrading to LTS Version 3.27.1+210531 2021-06-07 16:46:06 +02:00
Markus Opolka
4e99ca384c Upgrading to LTS Version 3.27.0+210525 2021-06-07 08:32:03 +02:00
Markus Opolka
30eef8abc1 Upgrade to LimeSurvey 5.0 (#62)
* Add Dockerfiles for LimeSurvey 5.0

 - This changes the default user to www-data in the Apache2 Images
 - Removed extra download layer
 - Add LS 5.0 Update Guide
 - Update base images to PHP 8.0
 - Add Variable for showScriptName
2021-06-07 07:59:53 +02:00
Markus Opolka
958ed57011 Upgrading to Version 4.6.3+210518 2021-05-25 18:52:23 +02:00
Markus Opolka
628cb942af Upgrading to LTS Version 3.26.5+210519 2021-05-25 18:51:31 +02:00
Markus Opolka
3165dffe31 Upgrading to Version 4.6.2+210512 2021-05-17 20:25:56 +02:00
Markus Opolka
bd28fb2796 Upgrading to LTS Version 3.26.3+210511 2021-05-17 20:25:11 +02:00
29 changed files with 990 additions and 83 deletions

View File

@@ -0,0 +1,109 @@
name: Publish Latest Container Images
on:
push:
tags:
- '5.*'
jobs:
lint_dockerfiles:
name: Lint Dockerfile with hadolint
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- 5.0/apache/Dockerfile
- 5.0/fpm-alpine/Dockerfile
- 5.0/fpm/Dockerfile
steps:
- uses: actions/checkout@v2
- uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ${{ matrix.dockerfile }}
ignore: DL4006 DL3008 DL3018
push_images_to_registries:
name: Push Container Images to registries
runs-on: ubuntu-latest
needs: [lint_dockerfiles]
environment: docker-build
permissions:
packages: write
contents: read
steps:
- name: 'Check out the repo'
uses: actions/checkout@v2
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: 'Log in to DockerHub'
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
## Can be enabled in the future
# - name: Log in to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: gchr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Apache variant metadata'
id: metadata-apache
uses: docker/metadata-action@v3
with:
images: |
docker.io/martialblog/limesurvey
## Can be enabled in the future
# ghcr.io/martialblog/limesurvey
tags: |
type=semver,pattern={{raw}},suffix=-apache
type=semver,pattern={{major}},suffix=-apache
flavor: |
latest=false
- name: 'Build and push latest Apache container images'
uses: docker/build-push-action@v2
with:
context: 5.0/apache
push: true
tags: ${{ steps.metadata-apache.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
- name: 'FPM variant metadata'
id: metadata-fpm
uses: docker/metadata-action@v3
with:
images: |
docker.io/martialblog/limesurvey
## Can be enabled in the future
# ghcr.io/martialblog/limesurvey
tags: |
type=semver,pattern={{version}},suffix=-fpm
type=semver,pattern={{major}},suffix=-fpm
- name: 'Build and push latest fpm container images'
uses: docker/build-push-action@v2
with:
context: 5.0/fpm
push: true
tags: ${{ steps.metadata-fpm.outputs.tags }}
labels: ${{ steps.metadata-fpm.outputs.labels }}
- name: 'FPM Alpine variant metadata'
id: metadata-fpm-alpine
uses: docker/metadata-action@v3
with:
images: |
docker.io/martialblog/limesurvey
## Can be enabled in the future
# ghcr.io/martialblog/limesurvey
tags: |
type=semver,pattern={{version}},suffix=-fpm-alpine
type=semver,pattern={{major}},suffix=-fpm-alpine
- name: 'Build and push latest fpm-alpine container images'
uses: docker/build-push-action@v2
with:
context: 5.0/fpm-alpine
push: true
tags: ${{ steps.metadata-fpm-alpine.outputs.tags }}
labels: ${{ steps.metadata-fpm-alpine.outputs.labels }}

View File

@@ -0,0 +1,110 @@
name: Publish LTS Container Images
on:
push:
tags:
- '3.*'
jobs:
lint_dockerfiles:
name: 'Lint Dockerfile with hadolint'
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- 3.0/apache/Dockerfile
- 3.0/fpm-alpine/Dockerfile
- 3.0/fpm/Dockerfile
steps:
- uses: actions/checkout@v2
- uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ${{ matrix.dockerfile }}
ignore: DL4006 DL3008 DL3018
push_images_to_registries:
name: 'Push container images to registries'
runs-on: ubuntu-latest
needs: [lint_dockerfiles]
environment: docker-build
permissions:
packages: write
contents: read
steps:
- name: 'Check out the repo'
uses: actions/checkout@v2
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: 'Log in to DockerHub'
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
## Can be enabled in the future
# - name: Log in to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: gchr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Apache variant metadata'
id: metadata-apache
uses: docker/metadata-action@v3
with:
images: |
docker.io/martialblog/limesurvey
## Can be enabled in the future
# ghcr.io/martialblog/limesurvey
tags: |
type=semver,pattern={{raw}},suffix=-apache
type=semver,pattern={{major}},suffix=-apache
flavor: |
latest=false
- name: 'Build and push LTS apache container images'
uses: docker/build-push-action@v2
with:
context: 3.0/apache
push: true
tags: ${{ steps.metadata-apache.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
- name: 'FPM variant metadata'
id: metadata-fpm
uses: docker/metadata-action@v3
with:
images: |
docker.io/martialblog/limesurvey
## Can be enabled in the future
# ghcr.io/martialblog/limesurvey
tags: |
type=semver,pattern={{version}},suffix=-fpm
type=semver,pattern={{major}},suffix=-fpm
- name: 'Build and push LTS fpm container images'
uses: docker/build-push-action@v2
with:
context: 3.0/fpm
push: true
tags: ${{ steps.metadata-fpm.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
- name: 'FPM Alpine variant metadata'
id: metadata-fpm-alpine
uses: docker/metadata-action@v3
with:
images: |
docker.io/martialblog/limesurvey
## Can be enabled in the future
# ghcr.io/martialblog/limesurvey
tags: |
type=semver,pattern={{version}},suffix=-fpm-alpine
type=semver,pattern={{major}},suffix=-fpm-alpine
- name: 'Build and push LTS fpm-alpine container images'
uses: docker/build-push-action@v2
with:
context: 3.0/fpm-alpine
push: true
tags: ${{ steps.metadata-fpm-alpine.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}

24
.github/workflows/lint-dockerfiles.yaml vendored Normal file
View File

@@ -0,0 +1,24 @@
---
name: Lint Dockerfile
on: [push, pull_request]
jobs:
lint:
name: Lint Dockerfile with hadolint
strategy:
matrix:
dockerfile:
- 3.0/apache/Dockerfile
- 3.0/fpm-alpine/Dockerfile
- 3.0/fpm/Dockerfile
- 5.0/apache/Dockerfile
- 5.0/fpm-alpine/Dockerfile
- 5.0/fpm/Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ${{ matrix.dockerfile }}
ignore: DL4006 DL3008 DL3018

View File

@@ -1,18 +0,0 @@
sudo: required
language: bash
services:
- docker
install:
jobs:
include:
- env: HADOLINT="${HOME}/hadolint"
script:
- curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/v1.23.0/hadolint-$(uname -s)-$(uname -m)"
- chmod 700 ${HADOLINT}
- git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 ${HADOLINT} --ignore DL4006 --ignore DL3008 --ignore DL3018
- env: TAG=martialblog/limesurvey-apache
script: cd 4.0/apache; docker build -q -t $TAG . && cd ../..; ./tests/run.sh $TAG
- env: TAG=martialblog/limesurvey-fpm
script: cd 4.0/fpm; docker build -q -t $TAG . && cd ../..; ./tests/run.sh $TAG
- env: TAG=martialblog/limesurvey-alpine
script: cd 4.0/fpm; docker build -q -t $TAG . && cd ../..; ./tests/run.sh $TAG

View File

@@ -1,7 +1,7 @@
FROM php:7.4-apache FROM php:7.4-apache
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.26.2+210503' ARG version='3.27.3+210615'
ARG sha256_checksum='f76f1983e9dbf432346679c5697189a64e41a795facffa392bb9c66ea0de5675' ARG sha256_checksum='b4986b8be45a2e3d9dbd92ecd724b5bc4aef751f194c00ed445ed0201ad82aa1'
ARG USER=root ARG USER=root
ARG LISTEN_PORT=80 ARG LISTEN_PORT=80
@@ -66,9 +66,8 @@ RUN a2enmod headers rewrite remoteip; \
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Download, unzip and chmod LimeSurvey from official GitHub repository # Download, unzip and chmod LimeSurvey from official GitHub repository
RUN curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz
RUN set -ex; \ RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \ echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\ \
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \ tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \

View File

@@ -37,7 +37,7 @@ fi
if [ "$LISTEN_PORT" != "80" ]; then if [ "$LISTEN_PORT" != "80" ]; then
echo "Info: Customizing Apache Listen port to $LISTEN_PORT" echo "Info: Customizing Apache Listen port to $LISTEN_PORT"
sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
fi fi
# Check if database is available # Check if database is available

View File

@@ -1,7 +1,7 @@
FROM php:7.4-fpm-alpine FROM php:7.4-fpm-alpine
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.26.2+210503' ARG version='3.27.3+210615'
ARG sha256_checksum='f76f1983e9dbf432346679c5697189a64e41a795facffa392bb9c66ea0de5675' ARG sha256_checksum='b4986b8be45a2e3d9dbd92ecd724b5bc4aef751f194c00ed445ed0201ad82aa1'
# Install OS dependencies # Install OS dependencies
RUN set -ex; \ RUN set -ex; \
@@ -35,10 +35,9 @@ RUN set -ex; \
tidy \ tidy \
zip zip
# Download, unzip and chmod of LimeSurvey # Download, unzip and chmod LimeSurvey from official GitHub repository
RUN curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz
RUN set -ex; \ RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \ echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\ \
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \ tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \

View File

@@ -1,7 +1,7 @@
FROM php:7.4-fpm FROM php:7.4-fpm
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.26.2+210503' ARG version='3.27.3+210615'
ARG sha256_checksum='f76f1983e9dbf432346679c5697189a64e41a795facffa392bb9c66ea0de5675' ARG sha256_checksum='b4986b8be45a2e3d9dbd92ecd724b5bc4aef751f194c00ed445ed0201ad82aa1'
# Install OS dependencies # Install OS dependencies
RUN set -ex; \ RUN set -ex; \
@@ -51,9 +51,8 @@ RUN set -ex; \
ENV LIMESURVEY_VERSION=$version ENV LIMESURVEY_VERSION=$version
# Download, unzip and chmod LimeSurvey from official GitHub repository # Download, unzip and chmod LimeSurvey from official GitHub repository
RUN curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz
RUN set -ex; \ RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \ echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\ \
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \ tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \

View File

@@ -1,7 +1,7 @@
FROM php:7.4-apache FROM php:7.4-apache
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='4.6.1+210510' ARG version='4.6.3+210518'
ARG sha256_checksum='6051b14d7c92e466799ed02710b7ecb0203613663769e93a4759e4a5b4175d85' ARG sha256_checksum='3c59afc13d0cf974c465c5f851cb8837117518e94031f5e3a28ba468ad734ce2'
ARG USER=root ARG USER=root
ARG LISTEN_PORT=80 ARG LISTEN_PORT=80
@@ -67,9 +67,8 @@ RUN a2enmod headers rewrite remoteip; \
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Download, unzip and chmod LimeSurvey from official GitHub repository # Download, unzip and chmod LimeSurvey from official GitHub repository
RUN curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz
RUN set -ex; \ RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \ echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\ \
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \ tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \

View File

@@ -41,7 +41,7 @@ fi
if [ "$LISTEN_PORT" != "80" ]; then if [ "$LISTEN_PORT" != "80" ]; then
echo "Info: Customizing Apache Listen port to $LISTEN_PORT" echo "Info: Customizing Apache Listen port to $LISTEN_PORT"
sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
fi fi
# Check if database is available # Check if database is available

View File

@@ -1,7 +1,7 @@
FROM php:7.4-fpm-alpine FROM php:7.4-fpm-alpine
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='4.6.1+210510' ARG version='4.6.3+210518'
ARG sha256_checksum='6051b14d7c92e466799ed02710b7ecb0203613663769e93a4759e4a5b4175d85' ARG sha256_checksum='3c59afc13d0cf974c465c5f851cb8837117518e94031f5e3a28ba468ad734ce2'
# Install OS dependencies # Install OS dependencies
RUN set -ex; \ RUN set -ex; \
@@ -36,10 +36,9 @@ RUN set -ex; \
tidy \ tidy \
zip zip
# Download, unzip and chmod of LimeSurvey # Download, unzip and chmod LimeSurvey from official GitHub repository
RUN curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz
RUN set -ex; \ RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \ echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\ \
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \ tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \

View File

@@ -1,7 +1,7 @@
FROM php:7.4-fpm FROM php:7.4-fpm
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='4.6.1+210510' ARG version='4.6.3+210518'
ARG sha256_checksum='6051b14d7c92e466799ed02710b7ecb0203613663769e93a4759e4a5b4175d85' ARG sha256_checksum='3c59afc13d0cf974c465c5f851cb8837117518e94031f5e3a28ba468ad734ce2'
# Install OS dependencies # Install OS dependencies
RUN set -ex; \ RUN set -ex; \
@@ -51,9 +51,8 @@ RUN set -ex; \
ENV LIMESURVEY_VERSION=$version ENV LIMESURVEY_VERSION=$version
# Download, unzip and chmod LimeSurvey from official GitHub repository # Download, unzip and chmod LimeSurvey from official GitHub repository
RUN curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz
RUN set -ex; \ RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \ echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\ \
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \ tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \

84
5.0/apache/Dockerfile Normal file
View File

@@ -0,0 +1,84 @@
FROM php:8-apache
LABEL maintainer="markus@martialblog.de"
ARG version='5.0.4+210614'
ARG sha256_checksum='b2981b68269f3c9711d7479a509bdef2763827e620b097f8a235f82dabc65f7b'
ARG USER=www-data
ARG LISTEN_PORT=8080
# Install OS dependencies
RUN set -ex; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \
\
libldap2-dev \
libfreetype6-dev \
libjpeg-dev \
libonig-dev \
zlib1g-dev \
libc-client-dev \
libkrb5-dev \
libpng-dev \
libpq-dev \
libzip-dev \
libtidy-dev \
libsodium-dev \
netcat \
curl \
\
&& apt-get -y autoclean; apt-get -y autoremove; \
rm -rf /var/lib/apt/lists/*
# Link LDAP library for PHP ldap extension
RUN set -ex; \
ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/
# Install PHP Plugins and Configure PHP imap plugin
RUN set -ex; \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr && \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install -j5 \
exif \
gd \
imap \
ldap \
mbstring \
pdo \
pdo_mysql \
pdo_pgsql \
pgsql \
sodium \
tidy \
zip
ENV LIMESURVEY_VERSION=$version
# Apache configuration
RUN a2enmod headers rewrite remoteip; \
{\
echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Download, unzip and chmod LimeSurvey from official GitHub repository
RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \
rm -f "/tmp/limesurvey.tar.gz" && \
chown -R "$USER:$USER" /var/www/html /etc/apache2
EXPOSE $LISTEN_PORT
WORKDIR /var/www/html
COPY entrypoint.sh entrypoint.sh
USER $USER
ENTRYPOINT ["/var/www/html/entrypoint.sh"]
CMD ["apache2-foreground"]

151
5.0/apache/entrypoint.sh Executable file
View File

@@ -0,0 +1,151 @@
#!/bin/bash
# Entrypoint for Docker Container
DB_TYPE=${DB_TYPE:-'mysql'}
DB_HOST=${DB_HOST:-'mysql'}
DB_PORT=${DB_PORT:-'3306'}
DB_SOCK=${DB_SOCK:-}
DB_NAME=${DB_NAME:-'limesurvey'}
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
DB_USERNAME=${DB_USERNAME:-'limesurvey'}
DB_PASSWORD=${DB_PASSWORD:-}
ENCRYPT_KEYPAIR=${ENCRYPT_KEYPAIR:-}
ENCRYPT_PUBLIC_KEY=${ENCRYPT_PUBLIC_KEY:-}
ENCRYPT_SECRET_KEY=${ENCRYPT_SECRET_KEY:-}
ADMIN_USER=${ADMIN_USER:-'admin'}
ADMIN_NAME=${ADMIN_NAME:-'admin'}
ADMIN_EMAIL=${ADMIN_EMAIL:-'foobar@example.com'}
ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
BASE_URL=${BASE_URL:-}
PUBLIC_URL=${PUBLIC_URL:-}
URL_FORMAT=${URL_FORMAT:-'path'}
SHOW_SCRIPT_NAME=${SHOW_SCRIPT_NAME:-'true'}
DEBUG=${DEBUG:-0}
DEBUG_SQL=${DEBUG_SQL:-0}
LISTEN_PORT=${LISTEN_PORT:-"8080"}
if [ -z "$DB_PASSWORD" ]; then
echo >&2 'Error: Missing DB_PASSWORD'
exit 1
fi
if [ -z "$ADMIN_PASSWORD" ]; then
echo >&2 'Error: Missing ADMIN_PASSWORD'
exit 1
fi
if [ "$LISTEN_PORT" != "80" ]; then
echo "Info: Customizing Apache Listen port to $LISTEN_PORT"
sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
fi
# Check if database is available
if [ -z "$DB_SOCK" ]; then
until nc -z -v -w30 $DB_HOST $DB_PORT
do
echo "Info: Waiting for database connection..."
sleep 5
done
fi
# Check if config already provisioned
if [ -f application/config/config.php ]; then
echo 'Info: config.php already provisioned'
else
echo 'Info: Generating config.php'
if [ "$DB_TYPE" = 'mysql' ]; then
echo 'Info: Using MySQL configuration'
DB_CHARSET=${DB_CHARSET:-'utf8mb4'}
fi
if [ "$DB_TYPE" = 'pgsql' ]; then
echo 'Info: Using PostgreSQL configuration'
DB_CHARSET=${DB_CHARSET:-'utf8'}
fi
if [ ! -z "$DB_SOCK" ]; then
echo 'Info: Using unix socket'
DB_CONNECT='unix_socket'
else
echo 'Info: Using TCP connection'
DB_CONNECT='host'
fi
if [ -z "$PUBLIC_URL" ]; then
echo 'Info: Setting PublicURL'
fi
cat <<EOF > application/config/config.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
return array(
'components' => array(
'db' => array(
'connectionString' => '$DB_TYPE:$DB_CONNECT=$DB_HOST;port=$DB_PORT;dbname=$DB_NAME;',
'emulatePrepare' => true,
'username' => '$DB_USERNAME',
'password' => '$DB_PASSWORD',
'charset' => '$DB_CHARSET',
'tablePrefix' => '$DB_TABLE_PREFIX',
),
'urlManager' => array(
'urlFormat' => '$URL_FORMAT',
'rules' => array(),
'showScriptName' => $SHOW_SCRIPT_NAME,
),
'request' => array(
'baseUrl' => '$BASE_URL',
),
),
'config'=>array(
'publicurl'=>'$PUBLIC_URL',
'debug'=>$DEBUG,
'debugsql'=>$DEBUG_SQL,
)
);
EOF
fi
# Check if security config already provisioned
if [ -f application/config/security.php ]; then
echo 'Info: security.php already provisioned'
else
echo 'Info: Creating security.php'
if [ ! -z "$ENCRYPT_KEYPAIR" ]; then
cat <<EOF > application/config/security.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
\$config = array();
\$config['encryptionkeypair'] = '$ENCRYPT_KEYPAIR';
\$config['encryptionpublickey'] = '$ENCRYPT_PUBLIC_KEY';
\$config['encryptionsecretkey'] = '$ENCRYPT_SECRET_KEY';
return \$config;
EOF
else
echo >&2 'Warning: No encryption keys were provided'
echo >&2 'Warning: A security.php config will be created by the application'
echo >&2 'Warning: THIS FILE NEEDS TO BE PERSISTENT'
fi
fi
# Check if LimeSurvey database is provisioned
echo 'Info: Check if database already provisioned. Nevermind the Stack trace.'
php application/commands/console.php updatedb
if [ $? -eq 0 ]; then
echo 'Info: Database already provisioned'
else
echo ''
echo 'Running console.php install'
php application/commands/console.php install $ADMIN_USER $ADMIN_PASSWORD $ADMIN_NAME $ADMIN_EMAIL
fi
exec "$@"

60
5.0/fpm-alpine/Dockerfile Normal file
View File

@@ -0,0 +1,60 @@
FROM php:8-fpm-alpine
LABEL maintainer="markus@martialblog.de"
ARG version='5.0.4+210614'
ARG sha256_checksum='b2981b68269f3c9711d7479a509bdef2763827e620b097f8a235f82dabc65f7b'
ARG USER=www-data
# Install OS dependencies
RUN set -ex; \
apk add --no-cache --virtual .build-deps \
freetype-dev \
libpng-dev \
libzip-dev \
libjpeg-turbo-dev \
tidyhtml-dev \
libsodium-dev \
openldap-dev \
oniguruma-dev \
imap-dev \
postgresql-dev && \
apk add --no-cache netcat-openbsd bash
# Install PHP Plugins
RUN set -ex; \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr && \
docker-php-ext-configure imap --with-imap-ssl && \
docker-php-ext-install \
exif \
gd \
imap \
ldap \
mbstring \
pdo \
pdo_mysql \
pdo_pgsql \
pgsql \
sodium \
tidy \
zip
# Download, unzip and chmod LimeSurvey from official GitHub repository
RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \
\
rm -rf "/tmp/limesurvey.tar.gz" \
/var/www/html/docs \
/var/www/html/tests \
/var/www/html/*.md && \
chown -R "${USER}:root" /var/www/ ; \
chmod -R g=u /var/www
EXPOSE 9000
WORKDIR /var/www/html
COPY entrypoint.sh entrypoint.sh
USER $USER
ENTRYPOINT ["/var/www/html/entrypoint.sh"]
CMD ["php-fpm"]

144
5.0/fpm-alpine/entrypoint.sh Executable file
View File

@@ -0,0 +1,144 @@
#!/bin/bash
# Entrypoint for Docker Container
DB_TYPE=${DB_TYPE:-'mysql'}
DB_HOST=${DB_HOST:-'mysql'}
DB_PORT=${DB_PORT:-'3306'}
DB_SOCK=${DB_SOCK:-}
DB_NAME=${DB_NAME:-'limesurvey'}
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
DB_USERNAME=${DB_USERNAME:-'limesurvey'}
DB_PASSWORD=${DB_PASSWORD:-}
ENCRYPT_KEYPAIR=${ENCRYPT_KEYPAIR:-}
ENCRYPT_PUBLIC_KEY=${ENCRYPT_PUBLIC_KEY:-}
ENCRYPT_SECRET_KEY=${ENCRYPT_SECRET_KEY:-}
ADMIN_USER=${ADMIN_USER:-'admin'}
ADMIN_NAME=${ADMIN_NAME:-'admin'}
ADMIN_EMAIL=${ADMIN_EMAIL:-'foobar@example.com'}
ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
BASE_URL=${BASE_URL:-}
PUBLIC_URL=${PUBLIC_URL:-}
URL_FORMAT=${URL_FORMAT:-'path'}
SHOW_SCRIPT_NAME=${SHOW_SCRIPT_NAME:-'true'}
DEBUG=${DEBUG:-0}
DEBUG_SQL=${DEBUG_SQL:-0}
if [ -z "$DB_PASSWORD" ]; then
echo >&2 'Error: Missing DB_PASSWORD'
exit 1
fi
if [ -z "$ADMIN_PASSWORD" ]; then
echo >&2 'Error: Missing ADMIN_PASSWORD'
exit 1
fi
# Check if database is available
if [ -z "$DB_SOCK" ]; then
until nc -z -v -w30 $DB_HOST $DB_PORT
do
echo "Info: Waiting for database connection..."
sleep 5
done
fi
# Check if config already provisioned
if [ -f application/config/config.php ]; then
echo 'Info: config.php already provisioned'
else
echo 'Info: Generating config.php'
if [ "$DB_TYPE" = 'mysql' ]; then
echo 'Info: Using MySQL configuration'
DB_CHARSET=${DB_CHARSET:-'utf8mb4'}
fi
if [ "$DB_TYPE" = 'pgsql' ]; then
echo 'Info: Using PostgreSQL configuration'
DB_CHARSET=${DB_CHARSET:-'utf8'}
fi
if [ ! -z "$DB_SOCK" ]; then
echo 'Info: Using unix socket'
DB_CONNECT='unix_socket'
else
echo 'Info: Using TCP connection'
DB_CONNECT='host'
fi
if [ -z "$PUBLIC_URL" ]; then
echo 'Info: Setting PublicURL'
fi
cat <<EOF > application/config/config.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
return array(
'components' => array(
'db' => array(
'connectionString' => '$DB_TYPE:$DB_CONNECT=$DB_HOST;port=$DB_PORT;dbname=$DB_NAME;',
'emulatePrepare' => true,
'username' => '$DB_USERNAME',
'password' => '$DB_PASSWORD',
'charset' => '$DB_CHARSET',
'tablePrefix' => '$DB_TABLE_PREFIX',
),
'urlManager' => array(
'urlFormat' => '$URL_FORMAT',
'rules' => array(),
'showScriptName' => $SHOW_SCRIPT_NAME,
),
'request' => array(
'baseUrl' => '$BASE_URL',
),
),
'config'=>array(
'publicurl'=>'$PUBLIC_URL',
'debug'=>$DEBUG,
'debugsql'=>$DEBUG_SQL,
)
);
EOF
fi
# Check if security config already provisioned
if [ -f application/config/security.php ]; then
echo 'Info: security.php already provisioned'
else
echo 'Info: Creating security.php'
if [ ! -z "$ENCRYPT_KEYPAIR" ]; then
cat <<EOF > application/config/security.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
\$config = array();
\$config['encryptionkeypair'] = '$ENCRYPT_KEYPAIR';
\$config['encryptionpublickey'] = '$ENCRYPT_PUBLIC_KEY';
\$config['encryptionsecretkey'] = '$ENCRYPT_SECRET_KEY';
return \$config;
EOF
else
echo >&2 'Warning: No encryption keys were provided'
echo >&2 'Warning: A security.php config will be created by the application'
echo >&2 'Warning: THIS FILE NEEDS TO BE PERSISTENT'
fi
fi
# Check if LimeSurvey database is provisioned
echo 'Info: Check if database already provisioned. Nevermind the Stack trace.'
php application/commands/console.php updatedb
if [ $? -eq 0 ]; then
echo 'Info: Database already provisioned'
else
echo ''
echo 'Running console.php install'
php application/commands/console.php install $ADMIN_USER $ADMIN_PASSWORD $ADMIN_NAME $ADMIN_EMAIL
fi
exec "$@"

69
5.0/fpm/Dockerfile Normal file
View File

@@ -0,0 +1,69 @@
FROM php:8-fpm
LABEL maintainer="markus@martialblog.de"
ARG version='5.0.4+210614'
ARG sha256_checksum='b2981b68269f3c9711d7479a509bdef2763827e620b097f8a235f82dabc65f7b'
ARG USER=www-data
# Install OS dependencies
RUN set -ex; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \
\
libldap2-dev \
libfreetype6-dev \
libjpeg-dev \
libonig-dev \
zlib1g-dev \
libc-client-dev \
libkrb5-dev \
libpng-dev \
libpq-dev \
libzip-dev \
libtidy-dev \
libsodium-dev \
netcat \
\
&& apt-get -y autoclean; apt-get -y autoremove; \
rm -rf /var/lib/apt/lists/*
# Link LDAP library for PHP ldap extension
RUN set -ex; \
ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/
# Install PHP Plugins and Configure PHP imap plugin
RUN set -ex; \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr && \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install -j5 \
exif \
gd \
imap \
ldap \
mbstring \
pdo \
pdo_mysql \
pdo_pgsql \
pgsql \
sodium \
tidy \
zip
ENV LIMESURVEY_VERSION=$version
# Download, unzip and chmod LimeSurvey from official GitHub repository
RUN set -ex; \
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \
rm -f "/tmp/limesurvey.tar.gz" && \
chown -R "$USER:$USER" /var/www/html
EXPOSE 9000
WORKDIR /var/www/html
COPY entrypoint.sh entrypoint.sh
USER $USER
ENTRYPOINT ["/var/www/html/entrypoint.sh"]
CMD ["php-fpm"]

144
5.0/fpm/entrypoint.sh Executable file
View File

@@ -0,0 +1,144 @@
#!/bin/bash
# Entrypoint for Docker Container
DB_TYPE=${DB_TYPE:-'mysql'}
DB_HOST=${DB_HOST:-'mysql'}
DB_PORT=${DB_PORT:-'3306'}
DB_SOCK=${DB_SOCK:-}
DB_NAME=${DB_NAME:-'limesurvey'}
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
DB_USERNAME=${DB_USERNAME:-'limesurvey'}
DB_PASSWORD=${DB_PASSWORD:-}
ENCRYPT_KEYPAIR=${ENCRYPT_KEYPAIR:-}
ENCRYPT_PUBLIC_KEY=${ENCRYPT_PUBLIC_KEY:-}
ENCRYPT_SECRET_KEY=${ENCRYPT_SECRET_KEY:-}
ADMIN_USER=${ADMIN_USER:-'admin'}
ADMIN_NAME=${ADMIN_NAME:-'admin'}
ADMIN_EMAIL=${ADMIN_EMAIL:-'foobar@example.com'}
ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
BASE_URL=${BASE_URL:-}
PUBLIC_URL=${PUBLIC_URL:-}
URL_FORMAT=${URL_FORMAT:-'path'}
SHOW_SCRIPT_NAME=${SHOW_SCRIPT_NAME:-'true'}
DEBUG=${DEBUG:-0}
DEBUG_SQL=${DEBUG_SQL:-0}
if [ -z "$DB_PASSWORD" ]; then
echo >&2 'Error: Missing DB_PASSWORD'
exit 1
fi
if [ -z "$ADMIN_PASSWORD" ]; then
echo >&2 'Error: Missing ADMIN_PASSWORD'
exit 1
fi
# Check if database is available
if [ -z "$DB_SOCK" ]; then
until nc -z -v -w30 $DB_HOST $DB_PORT
do
echo "Info: Waiting for database connection..."
sleep 5
done
fi
# Check if config already provisioned
if [ -f application/config/config.php ]; then
echo 'Info: config.php already provisioned'
else
echo 'Info: Generating config.php'
if [ "$DB_TYPE" = 'mysql' ]; then
echo 'Info: Using MySQL configuration'
DB_CHARSET=${DB_CHARSET:-'utf8mb4'}
fi
if [ "$DB_TYPE" = 'pgsql' ]; then
echo 'Info: Using PostgreSQL configuration'
DB_CHARSET=${DB_CHARSET:-'utf8'}
fi
if [ ! -z "$DB_SOCK" ]; then
echo 'Info: Using unix socket'
DB_CONNECT='unix_socket'
else
echo 'Info: Using TCP connection'
DB_CONNECT='host'
fi
if [ -z "$PUBLIC_URL" ]; then
echo 'Info: Setting PublicURL'
fi
cat <<EOF > application/config/config.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
return array(
'components' => array(
'db' => array(
'connectionString' => '$DB_TYPE:$DB_CONNECT=$DB_HOST;port=$DB_PORT;dbname=$DB_NAME;',
'emulatePrepare' => true,
'username' => '$DB_USERNAME',
'password' => '$DB_PASSWORD',
'charset' => '$DB_CHARSET',
'tablePrefix' => '$DB_TABLE_PREFIX',
),
'urlManager' => array(
'urlFormat' => '$URL_FORMAT',
'rules' => array(),
'showScriptName' => $SHOW_SCRIPT_NAME,
),
'request' => array(
'baseUrl' => '$BASE_URL',
),
),
'config'=>array(
'publicurl'=>'$PUBLIC_URL',
'debug'=>$DEBUG,
'debugsql'=>$DEBUG_SQL,
)
);
EOF
fi
# Check if security config already provisioned
if [ -f application/config/security.php ]; then
echo 'Info: security.php already provisioned'
else
echo 'Info: Creating security.php'
if [ ! -z "$ENCRYPT_KEYPAIR" ]; then
cat <<EOF > application/config/security.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
\$config = array();
\$config['encryptionkeypair'] = '$ENCRYPT_KEYPAIR';
\$config['encryptionpublickey'] = '$ENCRYPT_PUBLIC_KEY';
\$config['encryptionsecretkey'] = '$ENCRYPT_SECRET_KEY';
return \$config;
EOF
else
echo >&2 'Warning: No encryption keys were provided'
echo >&2 'Warning: A security.php config will be created by the application'
echo >&2 'Warning: THIS FILE NEEDS TO BE PERSISTENT'
fi
fi
# Check if LimeSurvey database is provisioned
echo 'Info: Check if database already provisioned. Nevermind the Stack trace.'
php application/commands/console.php updatedb
if [ $? -eq 0 ]; then
echo 'Info: Database already provisioned'
else
echo ''
echo 'Running console.php install'
php application/commands/console.php install $ADMIN_USER $ADMIN_PASSWORD $ADMIN_NAME $ADMIN_EMAIL
fi
exec "$@"

14
Makefile Normal file
View File

@@ -0,0 +1,14 @@
# .PHONY: apache fpm fpm-alpine
apache-lts:
docker build --pull -t martialblog/limesurvey:3-apache 3.0/apache
apache-latest:
docker build --pull -t martialblog/limesurvey:5-apache 5.0/apache
fpm-alpine-lts:
docker build --pull -t martialblog/limesurvey:3-fpm-alpine 3.0/fpm-alpine
fpm-alpine-latest:
docker build --pull -t martialblog/limesurvey:5-fpm-alpine 5.0/fpm-alpine
fpm-lts:
docker build --pull -t martialblog/limesurvey:3-fpm 3.0/fpm
fpm-latest:
docker build --pull -t martialblog/limesurvey:5-fpm 5.0/fpm

View File

@@ -12,12 +12,10 @@ Dockerfile to build a [LimeSurvey](https://limesurvey.org) Image for the Docker
## Supported tags and respective Dockerfile links ## Supported tags and respective Dockerfile links
- [`4-apache`, `4.<BUILD-NUMBER>-apache`, `latest` ](https://github.com/martialblog/docker-limesurvey/blob/master/4.0/apache/Dockerfile) - [`5-apache`, `5.<BUILD-NUMBER>-apache`, `latest` ](https://github.com/martialblog/docker-limesurvey/blob/master/5.0/apache/Dockerfile)
- [`4-apache-rootless`, `4.<BUILD-NUMBER>-apache-rootless`](https://github.com/martialblog/docker-limesurvey/blob/master/4.0/apache/Dockerfile) - [`5-fpm`, `5.<BUILD-NUMBER>-fpm`](https://github.com/martialblog/docker-limesurvey/blob/master/5.0/fpm/Dockerfile)
- [`4-fpm`, `4.<BUILD-NUMBER>-fpm`](https://github.com/martialblog/docker-limesurvey/blob/master/4.0/fpm/Dockerfile) - [`5-fpm-alpine`, `5.<BUILD-NUMBER>-fpm-alpine`](https://github.com/martialblog/docker-limesurvey/blob/master/5.0/fpm-alpine/Dockerfile)
- [`4-fpm-alpine`, `4.<BUILD-NUMBER>-fpm-alpine`](https://github.com/martialblog/docker-limesurvey/blob/master/4.0/fpm-alpine/Dockerfile)
- [`3-apache`, `3.<BUILD-NUMBER>-apache`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/apache/Dockerfile) - [`3-apache`, `3.<BUILD-NUMBER>-apache`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/apache/Dockerfile)
- [`3-apache-rootless`, `3.<BUILD-NUMBER>-apache-rootless`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/apache/Dockerfile)
- [`3-fpm`, `3.<BUILD-NUMBER>-fpm`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/fpm/Dockerfile) - [`3-fpm`, `3.<BUILD-NUMBER>-fpm`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/fpm/Dockerfile)
- [`3-fpm-alpine`, `3.<BUILD-NUMBER>-fpm-alpine`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/fpm-alpine/Dockerfile) - [`3-fpm-alpine`, `3.<BUILD-NUMBER>-fpm-alpine`](https://github.com/martialblog/docker-limesurvey/blob/master/3.0/fpm-alpine/Dockerfile)
@@ -25,7 +23,7 @@ Dockerfile to build a [LimeSurvey](https://limesurvey.org) Image for the Docker
The `apache` image comes with an Apache Webserver and PHP installed. The `apache` image comes with an Apache Webserver and PHP installed.
This image is also available as `rootless` with `www-data` as default user. This image is also available in a `rootless` variant with `www-data` as default user and Apache listening on 8080. Starting from 5.0, the `rootless` variant is the default for Apache images.
## Apache Configuration ## Apache Configuration
@@ -35,7 +33,7 @@ To change to Apache Webserver configuration, mount a Volume into the Container a
See the example configuration provided. See the example configuration provided.
If you want to run Apache on a non-privileged port inside the container, just specify a environment variable `LISTEN_PORT` (e.g. `LISTEN_PORT=8080`). The Apache port can be specified by setting the environment variable `LISTEN_PORT` (e.g. `LISTEN_PORT=8080`). Starting from 5.0, Apache defaults to listening on a non-privilged port (8080) in inside the container.
# Using the fpm Image # Using the fpm Image
@@ -75,7 +73,7 @@ To change to LimeSurvey configuration, you can mount a Volume into the Container
## Data encryption ## Data encryption
LimeSurvey 4 supports data encryption, this image give you these options: LimeSurvey version 4.0 and newer support data encryption, this image give you these options:
* Provide a security.php file directly (volume) * Provide a security.php file directly (volume)
* Provide encryption keys for the `security.php` file (environment variables) * Provide encryption keys for the `security.php` file (environment variables)
@@ -113,12 +111,13 @@ For further details on the settings see: https://manual.limesurvey.org/Data_encr
| PUBLIC_URL | Public URL for public scripts | | PUBLIC_URL | Public URL for public scripts |
| BASE_URL | Application Base URL | | BASE_URL | Application Base URL |
| URL_FORMAT | URL Format. path or get | | URL_FORMAT | URL Format. path or get |
| SHOW_SCRIPT_NAME | Script name in URL (true|false). Default: true |
| DEBUG | Debug level (0, 1, 2). Default: 0 | | DEBUG | Debug level (0, 1, 2). Default: 0 |
| DEBUG_SQL | SQL Debug level (0, 1, 2). Default 0 | | DEBUG_SQL | SQL Debug level (0, 1, 2). Default 0 |
| ENCRYPT_KEYPAIR | Data encryption keypair | | ENCRYPT_KEYPAIR | Data encryption keypair |
| ENCRYPT_PUBLIC_KEY | Data encryption public key | | ENCRYPT_PUBLIC_KEY | Data encryption public key |
| ENCRYPT_SECRET_KEY | Data encryption secret key | | ENCRYPT_SECRET_KEY | Data encryption secret key |
| LISTEN_PORT | Apache: Listen port. Default: 80 | | LISTEN_PORT | Apache: Listen port. Default: 8080 |
For further details on the settings see: https://manual.limesurvey.org/Optional_settings#Advanced_Path_Settings For further details on the settings see: https://manual.limesurvey.org/Optional_settings#Advanced_Path_Settings
@@ -136,6 +135,42 @@ http://localhost:8080/
http://localhost:8080/index.php/admin http://localhost:8080/index.php/admin
``` ```
# Upgrade Guide
These guides are only referring to the Docker Image, for details on the application users should consult the [official LimeSurvey documentation](https://manual.limesurvey.org/Upgrading_from_a_previous_version) for details.
## Upgrading the FPM Images
If you are using docker-compose to run the FPM Images, you need to stop the application and webserver Containers and delete the application volume:
```
$ docker volume ls
DRIVER VOLUME NAME
local docker-limesurvey_lime
$ docker volume rm docker-limesurvey_lime
```
## Upgrading to 5.0 from 4.x
The default user in the Container will now be *www-data* (uid 33 in Debian, uid 82 in Alpine), any volumes mounted need the corresponding permissions:
```
# Debian
$ ls -ln upload/
total 4
drwxr-xr-x 3 33 33 4096 Jun 3 13:51 surveys
```
```
# Alpine
$ ls -ln upload/
total 4
drwxr-xr-x 3 82 82 4096 Jun 3 13:51 surveys
```
If you are using the Apache2 Images, the default port will now be **8080**. Depending on your setup the port configurations might need adjustment.
# References # References
- https://www.limesurvey.org/ - https://www.limesurvey.org/

View File

@@ -18,7 +18,7 @@ services:
volumes: volumes:
- limesurvey:/var/www/html/upload/surveys - limesurvey:/var/www/html/upload/surveys
ports: ports:
- 8080:80 - 8080:8080
depends_on: depends_on:
- db - db
db: db:

View File

@@ -2,9 +2,10 @@ version: "3.0"
services: services:
limesurvey: limesurvey:
build: build:
context: 4.0/fpm/ context: 5.0/fpm/
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
# Hint: This is just an example, change /tmp to something persistent
- /tmp/upload/surveys:/var/www/html/upload/surveys - /tmp/upload/surveys:/var/www/html/upload/surveys
- lime:/var/www/html - lime:/var/www/html
links: links:

View File

@@ -2,9 +2,10 @@ version: "3.0"
services: services:
limesurvey: limesurvey:
build: build:
context: 4.0/fpm-alpine/ context: 5.0/fpm-alpine/
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
# Hint: This is just an example, change /tmp to something persistent
- /tmp/upload/surveys:/var/www/html/upload/surveys - /tmp/upload/surveys:/var/www/html/upload/surveys
- lime:/var/www/html - lime:/var/www/html
links: links:

View File

@@ -2,9 +2,10 @@ version: "3.0"
services: services:
limesurvey: limesurvey:
build: build:
context: 4.0/fpm/ context: 5.0/fpm/
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
# Hint: This is just an example, change /tmp to something persistent
- /tmp/upload/surveys:/var/www/html/upload/surveys - /tmp/upload/surveys:/var/www/html/upload/surveys
- lime:/var/www/html - lime:/var/www/html
links: links:

View File

@@ -2,16 +2,17 @@ version: "3.0"
services: services:
limesurvey: limesurvey:
build: build:
context: 4.0/apache/ context: 5.0/apache/
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
# Hint: This is just an example, change /tmp to something persistent
- /tmp/upload/surveys:/var/www/html/upload/surveys - /tmp/upload/surveys:/var/www/html/upload/surveys
links: links:
- lime-db - lime-db
depends_on: depends_on:
- lime-db - lime-db
ports: ports:
- "8080:80" - "8080:8080"
environment: environment:
- "DB_TYPE=pgsql" - "DB_TYPE=pgsql"
- "DB_PORT=5432" - "DB_PORT=5432"

View File

@@ -2,16 +2,17 @@ version: "3.0"
services: services:
limesurvey: limesurvey:
build: build:
context: 4.0/apache/ context: 5.0/apache/
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
# Hint: This is just an example, change /tmp to something persistent
- /tmp/upload/surveys:/var/www/html/upload/surveys - /tmp/upload/surveys:/var/www/html/upload/surveys
links: links:
- lime-db - lime-db
depends_on: depends_on:
- lime-db - lime-db
ports: ports:
- "8080:80" - "8080:8080"
environment: environment:
- "DB_HOST=lime-db" - "DB_HOST=lime-db"
- "DB_PASSWORD=secret" - "DB_PASSWORD=secret"

View File

@@ -1,4 +1,4 @@
<VirtualHost *:80> <VirtualHost *:8080>
ServerAdmin foo@bar.com ServerAdmin foo@bar.com
DocumentRoot /var/www/html DocumentRoot /var/www/html
Alias /lime "/var/www/html" Alias /lime "/var/www/html"

View File

@@ -1,18 +0,0 @@
.PHONY: apache fpm fpm-alpine
apache3:
docker build --pull -t martialblog/limesurvey:3-apache 3.0/apache
apache3-rootless:
docker build --pull --build-arg USER=www-data --build-arg LISTEN_PORT=8080 -t martialblog/limesurvey:3-apache-rootless 3.0/apache
apache4:
docker build --pull -t martialblog/limesurvey:3-apache 3.0/apache
apache4-rootless:
docker build --pull --build-arg USER=www-data --build-arg LISTEN_PORT=8080 -t martialblog/limesurvey:4-apache-rootless 4.0/apache
fpm-alpine3:
docker build --pull -t martialblog/limesurvey:3-fpm-alpine 3.0/fpm-alpine
fpm-alpine4:
docker build --pull -t martialblog/limesurvey:4-fpm-alpine 4.0/fpm-alpine
fpm3:
docker build --pull -t martialblog/limesurvey:3-fpm 3.0/fpm
fpm4:
docker build --pull -t martialblog/limesurvey:4-fpm 4.0/fpm

View File

@@ -32,4 +32,4 @@ sed -r -i -e "s/[A-Fa-f0-9]{64}/$SHA256_CHECKSUM/" $MAJOR_VERSION/apache/Dockerf
# After that, check and commit # After that, check and commit
echo "git add 3.0 ; git commit -m 'Upgrading to LTS Version ${NEW_VERSION}' && git tag ${NEW_VERSION}" echo "git add 3.0 ; git commit -m 'Upgrading to LTS Version ${NEW_VERSION}' && git tag ${NEW_VERSION}"
echo "git add 4.0 ; git commit -m 'Upgrading to Version ${NEW_VERSION}' && git tag ${NEW_VERSION}" echo "git add 5.0 ; git commit -m 'Upgrading to Version ${NEW_VERSION}' && git tag ${NEW_VERSION}"