Compare commits

...

15 Commits

Author SHA1 Message Date
Markus Opolka
980e145ea4 Upgrading to Version 3.15.3+181108 2018-11-09 13:23:21 +01:00
Markus Opolka
e978fd0717 Upgrading to Version 3.15.1+181017 2018-11-08 09:33:09 +01:00
Markus Opolka
2fa1f94b20 Upgrading to Version 3.15.0+181008 2018-10-18 10:09:20 +02:00
Markus Opolka
cf09eeba7c Upgrading to Version 3.14.10+180926 2018-10-09 08:12:57 +02:00
Markus Opolka
75f9c151a7 Upgrading to Version 3.14.10+180924 2018-09-27 09:27:09 +02:00
Markus Opolka
a5f3d91340 Upgrading to Version 3.14.9+180917 2018-09-26 07:50:38 +02:00
Markus Opolka
55c23248bd Upgrading to Version 3.14.8+180829 2018-09-17 17:44:00 +02:00
Markus Opolka
91ab6439de Merge pull request #14 from martialblog/unix-socket
Add socket check before waiting for database connection
2018-09-15 14:11:12 +02:00
Jack Henschel
b443ca12a7 Add socket check before waiting for database connection
database connection checking with netcat is only possible when
using a TCP/IP connection, just launch the application when the
user chooses a unix socket
2018-09-14 13:41:47 +02:00
Markus Opolka
a05a2528c6 Merge pull request #13 from martialblog/unix-socket
Add option to use unix_socket instead of tcp connection for DB
2018-09-14 09:44:32 +02:00
Jack Henschel
610c377680 Add option to use unix_socket instead of tcp connection for DB 2018-09-14 09:21:04 +02:00
Markus Opolka
cc34159e53 Upgrading to Version 3.14.7+180827 2018-08-31 11:09:42 +02:00
Markus Opolka
cc6937054e Upgrading to Version 3.14.6+180821 2018-08-28 11:02:29 +02:00
Markus Opolka
8f9f1933eb Upgrading to version 3.14.5+180815 2018-08-21 14:38:15 +02:00
Markus Opolka
c59df8396e Add alpine to update script 2018-08-21 14:36:17 +02:00
8 changed files with 55 additions and 22 deletions

View File

@@ -48,6 +48,7 @@ To change to LimeSurvey configuration, you can mount a Volume into the Container
| DB_TYPE | Database Type to use. mysql or pgsql | | DB_TYPE | Database Type to use. mysql or pgsql |
| DB_HOST | Database server hostname | | DB_HOST | Database server hostname |
| DB_PORT | Database server port | | DB_PORT | Database server port |
| DB_SOCK | Database unix socket instead of host/port |
| DB_NAME | Database name | | DB_NAME | Database name |
| DB_TABLE_PREFIX | Database table prefix | | DB_TABLE_PREFIX | Database table prefix |
| DB_USERNAME | Database user | | DB_USERNAME | Database user |

View File

@@ -1,6 +1,6 @@
FROM php:7.2-apache FROM php:7.2-apache
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.14.4+180810' ARG version='3.15.3+181108'
# Install OS dependencies # Install OS dependencies
RUN apt-get update && \ RUN apt-get update && \

View File

@@ -5,6 +5,7 @@
DB_TYPE=${DB_TYPE:-'mysql'} DB_TYPE=${DB_TYPE:-'mysql'}
DB_HOST=${DB_HOST:-'mysql'} DB_HOST=${DB_HOST:-'mysql'}
DB_PORT=${DB_PORT:-'3306'} DB_PORT=${DB_PORT:-'3306'}
DB_SOCK=${DB_SOCK:-}
DB_NAME=${DB_NAME:-'limesurvey'} DB_NAME=${DB_NAME:-'limesurvey'}
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'} DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
DB_USERNAME=${DB_USERNAME:-'limesurvey'} DB_USERNAME=${DB_USERNAME:-'limesurvey'}
@@ -20,11 +21,13 @@ URL_FORMAT=${URL_FORMAT:-'path'}
# Check if database is available # Check if database is available
if [ -z "$DB_SOCK" ]; then
until nc -z -v -w30 $DB_HOST $DB_PORT until nc -z -v -w30 $DB_HOST $DB_PORT
do do
echo "Info: Waiting for database connection..." echo "Info: Waiting for database connection..."
sleep 5 sleep 5
done done
fi
# Check if already provisioned # Check if already provisioned
@@ -46,7 +49,14 @@ else
fi fi
# Set Database config # Set Database config
if [ ! -z "$DB_SOCK" ]; then
echo 'Info: Using unix socket'
sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:unix_socket=${DB_SOCK};dbname=${DB_NAME};',#g" application/config/config.php
else
echo 'Info: Using TCP connection'
sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:host=${DB_HOST};port=${DB_PORT};dbname=${DB_NAME};',#g" application/config/config.php sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:host=${DB_HOST};port=${DB_PORT};dbname=${DB_NAME};',#g" application/config/config.php
fi
sed -i "s#\('username' => \).*,\$#\\1'${DB_USERNAME}',#g" application/config/config.php sed -i "s#\('username' => \).*,\$#\\1'${DB_USERNAME}',#g" application/config/config.php
sed -i "s#\('password' => \).*,\$#\\1'${DB_PASSWORD}',#g" application/config/config.php sed -i "s#\('password' => \).*,\$#\\1'${DB_PASSWORD}',#g" application/config/config.php
sed -i "s#\('charset' => \).*,\$#\\1'${DB_CHARSET}',#g" application/config/config.php sed -i "s#\('charset' => \).*,\$#\\1'${DB_CHARSET}',#g" application/config/config.php

View File

@@ -1,6 +1,6 @@
FROM php:7.2-fpm-alpine FROM php:7.2-fpm-alpine
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.14.4+180810' ARG version='3.15.3+181108'
# Install OS dependencies # Install OS dependencies
RUN apk add --no-cache --virtual .build-deps \ RUN apk add --no-cache --virtual .build-deps \

View File

@@ -1,10 +1,11 @@
#!/bin/sh #!/bin/bash
# Entrypoint for Docker Container # Entrypoint for Docker Container
DB_TYPE=${DB_TYPE:-'mysql'} DB_TYPE=${DB_TYPE:-'mysql'}
DB_HOST=${DB_HOST:-'mysql'} DB_HOST=${DB_HOST:-'mysql'}
DB_PORT=${DB_PORT:-'3306'} DB_PORT=${DB_PORT:-'3306'}
DB_SOCK=${DB_SOCK:-}
DB_NAME=${DB_NAME:-'limesurvey'} DB_NAME=${DB_NAME:-'limesurvey'}
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'} DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
DB_USERNAME=${DB_USERNAME:-'limesurvey'} DB_USERNAME=${DB_USERNAME:-'limesurvey'}
@@ -20,11 +21,13 @@ URL_FORMAT=${URL_FORMAT:-'path'}
# Check if database is available # Check if database is available
if [ -z "$DB_SOCK" ]; then
until nc -z -v -w30 $DB_HOST $DB_PORT until nc -z -v -w30 $DB_HOST $DB_PORT
do do
echo "Info: Waiting for database connection..." echo "Info: Waiting for database connection..."
sleep 5 sleep 5
done done
fi
# Check if already provisioned # Check if already provisioned
@@ -46,7 +49,14 @@ else
fi fi
# Set Database config # Set Database config
if [ ! -z "$DB_SOCK" ]; then
echo 'Info: Using unix socket'
sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:unix_socket=${DB_SOCK};dbname=${DB_NAME};',#g" application/config/config.php
else
echo 'Info: Using TCP connection'
sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:host=${DB_HOST};port=${DB_PORT};dbname=${DB_NAME};',#g" application/config/config.php sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:host=${DB_HOST};port=${DB_PORT};dbname=${DB_NAME};',#g" application/config/config.php
fi
sed -i "s#\('username' => \).*,\$#\\1'${DB_USERNAME}',#g" application/config/config.php sed -i "s#\('username' => \).*,\$#\\1'${DB_USERNAME}',#g" application/config/config.php
sed -i "s#\('password' => \).*,\$#\\1'${DB_PASSWORD}',#g" application/config/config.php sed -i "s#\('password' => \).*,\$#\\1'${DB_PASSWORD}',#g" application/config/config.php
sed -i "s#\('charset' => \).*,\$#\\1'${DB_CHARSET}',#g" application/config/config.php sed -i "s#\('charset' => \).*,\$#\\1'${DB_CHARSET}',#g" application/config/config.php

View File

@@ -1,6 +1,6 @@
FROM php:7.2-fpm FROM php:7.2-fpm
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.14.4+180810' ARG version='3.15.3+181108'
# Install OS dependencies # Install OS dependencies
RUN apt-get update && \ RUN apt-get update && \

View File

@@ -5,6 +5,7 @@
DB_TYPE=${DB_TYPE:-'mysql'} DB_TYPE=${DB_TYPE:-'mysql'}
DB_HOST=${DB_HOST:-'mysql'} DB_HOST=${DB_HOST:-'mysql'}
DB_PORT=${DB_PORT:-'3306'} DB_PORT=${DB_PORT:-'3306'}
DB_SOCK=${DB_SOCK:-}
DB_NAME=${DB_NAME:-'limesurvey'} DB_NAME=${DB_NAME:-'limesurvey'}
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'} DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
DB_USERNAME=${DB_USERNAME:-'limesurvey'} DB_USERNAME=${DB_USERNAME:-'limesurvey'}
@@ -20,11 +21,13 @@ URL_FORMAT=${URL_FORMAT:-'path'}
# Check if database is available # Check if database is available
if [ -z "$DB_SOCK" ]; then
until nc -z -v -w30 $DB_HOST $DB_PORT until nc -z -v -w30 $DB_HOST $DB_PORT
do do
echo "Info: Waiting for database connection..." echo "Info: Waiting for database connection..."
sleep 5 sleep 5
done done
fi
# Check if already provisioned # Check if already provisioned
@@ -46,7 +49,14 @@ else
fi fi
# Set Database config # Set Database config
if [ ! -z "$DB_SOCK" ]; then
echo 'Info: Using unix socket'
sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:unix_socket=${DB_SOCK};dbname=${DB_NAME};',#g" application/config/config.php
else
echo 'Info: Using TCP connection'
sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:host=${DB_HOST};port=${DB_PORT};dbname=${DB_NAME};',#g" application/config/config.php sed -i "s#\('connectionString' => \).*,\$#\\1'${DB_TYPE}:host=${DB_HOST};port=${DB_PORT};dbname=${DB_NAME};',#g" application/config/config.php
fi
sed -i "s#\('username' => \).*,\$#\\1'${DB_USERNAME}',#g" application/config/config.php sed -i "s#\('username' => \).*,\$#\\1'${DB_USERNAME}',#g" application/config/config.php
sed -i "s#\('password' => \).*,\$#\\1'${DB_PASSWORD}',#g" application/config/config.php sed -i "s#\('password' => \).*,\$#\\1'${DB_PASSWORD}',#g" application/config/config.php
sed -i "s#\('charset' => \).*,\$#\\1'${DB_CHARSET}',#g" application/config/config.php sed -i "s#\('charset' => \).*,\$#\\1'${DB_CHARSET}',#g" application/config/config.php

View File

@@ -8,6 +8,7 @@ import subprocess
dockerfile_apache = 'apache/Dockerfile' dockerfile_apache = 'apache/Dockerfile'
dockerfile_fpm = 'fpm/Dockerfile' dockerfile_fpm = 'fpm/Dockerfile'
dockerfile_alpine = 'fpm-alpine/Dockerfile'
limesv_feed_url = 'https://github.com/LimeSurvey/LimeSurvey/releases.atom' limesv_feed_url = 'https://github.com/LimeSurvey/LimeSurvey/releases.atom'
docker_feed_url = 'https://github.com/martialblog/docker-limesurvey/releases.atom' docker_feed_url = 'https://github.com/martialblog/docker-limesurvey/releases.atom'
@@ -39,6 +40,7 @@ commit_message = 'Updating to Version {}'.format(limesv_current_release)
regexp = 's/[0-9]+\.[0-9]+\.[0-9]+[0-9]*/{new_version}/'.format(new_version=limesv_current_release) regexp = 's/[0-9]+\.[0-9]+\.[0-9]+[0-9]*/{new_version}/'.format(new_version=limesv_current_release)
subprocess.call(['sed', '-i', '-e', regexp, dockerfile_apache]) subprocess.call(['sed', '-i', '-e', regexp, dockerfile_apache])
subprocess.call(['sed', '-i', '-e', regexp, dockerfile_fpm]) subprocess.call(['sed', '-i', '-e', regexp, dockerfile_fpm])
subprocess.call(['sed', '-i', '-e', regexp, dockerfile_alpine])
print('> Updated Dockerfiles') print('> Updated Dockerfiles')
# Git Commit/Tag # Git Commit/Tag