Browse Source

add limesurvey, fix #74

Guilhem Saurel 6 years ago
parent
commit
52df59c85d

+ 17 - 0
limesurvey/Dockerfile.fpm

@@ -0,0 +1,17 @@
+FROM php:fpm-alpine
+
+RUN apk --no-cache add libpng-dev imap-dev libzip-dev postgresql-dev \
+ && docker-php-ext-install mbstring pdo_pgsql gd imap zip
+
+ENV URL=https://www.limesurvey.org/fr/version-stable?download=2513:limesurvey3155%20181115targz \
+    SHA=ee34369cecd5965b318ed7b2123fa1c66d166a83e89090bd99b7c98758fd22d6 \
+    FILE=limesurvey.tar.gz
+
+RUN wget -q $URL -O $FILE \
+ && echo "$SHA  $FILE" | sha256sum -c \
+ && tar xf $FILE --strip-components=1 \
+ && rm $FILE
+
+RUN chown -R www-data tmp upload application/config
+
+VOLUME /var/www/html

+ 3 - 0
limesurvey/Dockerfile.nginx

@@ -0,0 +1,3 @@
+FROM nginx:alpine
+
+ADD nginx.conf /etc/nginx/conf.d/default.conf

+ 14 - 0
limesurvey/README.md

@@ -0,0 +1,14 @@
+# Limesurvey
+
+https://www.limesurvey.org/
+
+## Usage
+
+```
+echo POSTGRES_PASSWORD=$(openssl rand -base64 32) >> .env
+docker-compose up -d --build
+```
+
+Go to your webbrowser to finish installation:
+- DB name / DB host / DB user: `postgres`
+- DB password: look inside .env

+ 40 - 0
limesurvey/docker-compose.yml

@@ -0,0 +1,40 @@
+version: '3'
+
+networks:
+  web:
+    external: true
+
+volumes:
+  vol:
+
+services:
+  postgres:
+    image: postgres:11-alpine
+    restart: unless-stopped
+    env_file:
+      - .env
+    volumes:
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/limesurvey/sql:/var/lib/postgresql/data
+
+  app:
+    build:
+      context: .
+      dockerfile: Dockerfile.fpm
+    restart: unless-stopped
+    env_file:
+      - .env
+    volumes:
+      - vol:/var/www/html
+
+  web:
+    build:
+      context: .
+      dockerfile: Dockerfile.nginx
+    labels:
+      traefik.enable: "true"
+      traefik.frontend.rule: "Host: limesurvey.${CHATONS_DOMAIN:-localhost}, www.limesurvey.${CHATONS_DOMAIN:-localhost}"
+    networks:
+      - web
+      - default
+    volumes:
+      - vol:/var/www/html

+ 19 - 0
limesurvey/nginx.conf

@@ -0,0 +1,19 @@
+server {
+    listen 80;
+    root /var/www/html;
+    index index.php index.html;
+    location ~ [^/]\.php(/|$) {
+        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+        if (!-f $document_root$fastcgi_script_name) {
+            return 404;
+        }
+        # Mitigate https://httpoxy.org/ vulnerabilities
+        fastcgi_param HTTP_PROXY "";
+
+        fastcgi_pass app:9000;
+        fastcgi_index index.php;
+
+        include fastcgi_params;
+        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
+    }
+}