[survey-web/oscp] Base Dockerfile on https://github.com/adamzammit/limesurvey-docker
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [survey-web/oscp] Base Dockerfile on https://github.com/adamzammit/limesurvey-docker
- Date: Fri, 6 Mar 2020 16:48:40 +0000 (UTC)
commit a1cb8a3dd6cc7d4dc65264ffcc740ea26f1cfad4
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Fri Mar 6 17:47:12 2020 +0100
Base Dockerfile on https://github.com/adamzammit/limesurvey-docker
docker/Dockerfile | 84 ++++++++++++++++++++++++++++++++++++-------------------
docker/run.sh | 7 ++---
2 files changed, 58 insertions(+), 33 deletions(-)
---
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 4e6a9dc..bf9ff5c 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,32 +1,58 @@
-#github.com/garywong-bc/nrm-survey
-FROM centos/php-72-centos7
-
-ENV LIMESURVEY_PACKAGE=https://www.limesurvey.org/stable-release?download=2874:limesurvey418%20200302targz
-
-USER root
-RUN yum -y install epel-release
-RUN yum install -y rh-php72-php-imap rh-php72-php-ldap rh-php72-php-sodium
-RUN rm -rf /var/cache/yum/* && yum clean all
-
-RUN rm -rf /app && mkdir -p /app
-RUN curl -L -o /app/limesurvey.tar.gz "$LIMESURVEY_PACKAGE"
-RUN tar -C /app -xf /app/limesurvey.tar.gz
-RUN rm /app/limesurvey.tar.gz
-COPY config.php /app/limesurvey/application/config/
-
-COPY ipa-ca.crt /etc/pki/ca-trust/source/anchors
-RUN update-ca-trust
-
-RUN rm /etc/httpd/conf.d/welcome.conf
-COPY 00_surveys.gnome.org.conf /etc/httpd/conf.d
-
-RUN chmod -R a+rwx /app/limesurvey/tmp
-RUN chmod -R a+rwx /app/limesurvey/upload
-RUN chmod -R a+rwx /app/limesurvey/themes
-RUN chmod -R a+rwx /app/limesurvey/application/config
-
-USER 1001
+# https://github.com/adamzammit/limesurvey-docker
+FROM php:7.3-apache
+
+ENV DOWNLOAD_URL https://www.limesurvey.org/stable-release?download=2874:limesurvey418%20200302targz
+ENV DOWNLOAD_SHA256 a571d622a8789860b0a12b93e0a9cd5520c8b93ff9032425de8c1c030aa21681
+
+# install the PHP extensions we need
+RUN apt-get update && apt-get install -y libc-client-dev libfreetype6-dev libmcrypt-dev libpng-dev
libjpeg-dev libldap2-dev zlib1g-dev libkrb5-dev libtidy-dev libzip-dev libsodium-dev && rm -rf
/var/lib/apt/lists/* \
+ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr
--with-jpeg-dir=/usr \
+ && docker-php-ext-install gd mysqli pdo pdo_mysql opcache zip iconv tidy \
+ && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \
+ && docker-php-ext-install ldap \
+ && docker-php-ext-configure imap --with-imap-ssl --with-kerberos \
+ && docker-php-ext-install imap \
+ && docker-php-ext-install sodium \
+ && pecl install mcrypt-1.0.3 \
+ && docker-php-ext-enable mcrypt \
+ && docker-php-ext-install exif
+
+RUN a2enmod rewrite
+
+# set recommended PHP.ini settings
+# see https://secure.php.net/manual/en/opcache.installation.php
+RUN { \
+ echo 'opcache.memory_consumption=128'; \
+ echo 'opcache.interned_strings_buffer=8'; \
+ echo 'opcache.max_accelerated_files=4000'; \
+ echo 'opcache.revalidate_freq=2'; \
+ echo 'opcache.fast_shutdown=1'; \
+ echo 'opcache.enable_cli=1'; \
+ } > /usr/local/etc/php/conf.d/opcache-recommended.ini
+
+RUN set -x; \
+ curl -SL "$DOWNLOAD_URL" -o /tmp/lime.tar.gz; \
+ echo "$DOWNLOAD_SHA256 /tmp/lime.tar.gz" | sha256sum -c -; \
+ tar xf /tmp/lime.tar.gz --strip-components=1 -C /var/www/html; \
+ rm /tmp/lime.tar.gz; \
+ chown -R www-data:www-data /var/www/html
+COPY config.php /var/www/html/application/config/
+
+#Set PHP defaults for Limesurvey (allow bigger uploads)
+RUN { \
+ echo 'memory_limit=256M'; \
+ echo 'upload_max_filesize=128M'; \
+ echo 'post_max_size=128M'; \
+ echo 'max_execution_time=120'; \
+ echo 'max_input_vars=10000'; \
+ echo 'date.timezone=UTC'; \
+ } > /usr/local/etc/php/conf.d/uploads.ini
+
+RUN chmod -R a+rwx /var/www/html/tmp
+RUN chmod -R a+rwx /var/www/html/upload
+RUN chmod -R a+rwx /var/www/html/themes
+RUN chmod -R a+rwx /var/www/html/application/config
COPY run.sh /tmp/entrypoint.sh
-EXPOSE 8843
+EXPOSE 8080
ENTRYPOINT ["/tmp/entrypoint.sh"]
diff --git a/docker/run.sh b/docker/run.sh
index e9fb4bb..c5d5d2d 100755
--- a/docker/run.sh
+++ b/docker/run.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-config=/app/limesurvey/application/config/config.php
+config=/var/www/html/plugins/application/config/config.php
echo -ne "Configuring limesurvey database config file..."
if [ -f $config ]
@@ -15,7 +15,6 @@ else
echo SKIPPING as config file is missing
fi
-cd /app/limesurvey/application/commands/
+cd /var/www/html//application/commands/
php console.php install admin $LIMESURVEY_ADMIN_PASSWORD Administrator $LIMESURVEY_ADMIN_EMAIL
-
-exec httpd -DFOREGROUND
+exec apache2-foreground
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]