Explorar el Código

Make php.ini available in /app/data/

Johannes Zellner hace 8 años
padre
commit
96ccf279af
Se han modificado 2 ficheros con 8 adiciones y 2 borrados
  1. 3 1
      Dockerfile
  2. 5 1
      start.sh

+ 3 - 1
Dockerfile

@@ -4,7 +4,7 @@ MAINTAINER Johannes Zellner <johannes@cloudron.io>
 RUN mkdir -p /app/code /run/app/sessions
 WORKDIR /app/code
 
-RUN apt-get update && apt-get install -y php libapache2-mod-php crudinit \
+RUN apt-get update && apt-get install -y php libapache2-mod-php crudini \
     php-redis \
     php-bcmath \
     php-bz2 \
@@ -62,6 +62,8 @@ RUN crudini --set /etc/php/7.0/apache2/php.ini PHP upload_max_filesize 8M && \
     crudini --set /etc/php/7.0/apache2/php.ini PHP memory_limit 64M && \
     crudini --set /etc/php/7.0/apache2/php.ini Session session.save_path /run/app/sessions
 
+RUN mv /etc/php/7.0/apache2/php.ini /etc/php/7.0/apache2/php.ini.orig && ln -sf /app/data/php.ini /etc/php/7.0/apache2/php.ini
+
 ADD apache2-app.conf /app/code/apache2-app.conf
 ADD index.html /app/code/index.html
 ADD start.sh /app/code/start.sh

+ 5 - 1
start.sh

@@ -10,6 +10,10 @@ for f in /app/data/public/index.*; do
     break
 done
 
+if [ ! -f "/app/data/php.ini" ]; then
+    cp /etc/php/7.0/apache2/php.ini.orig /app/data/php.ini
+fi
+
 if [ ! -f "/app/data/apache2-app.conf" ]; then
     cp /app/code/apache2-app.conf /app/data/apache2-app.conf
 fi
@@ -21,7 +25,7 @@ sed -e "s@AuthLDAPURL .*@AuthLDAPURL ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username?
 
 ## hook for custom start script in /app/data/run.sh
 if [ -f "/app/data/run.sh" ]; then
-	/bin/bash /app/data/run.sh
+    /bin/bash /app/data/run.sh
 fi
 
 chown -R www-data:www-data /app/data /run