diff --git a/Dockerfile b/Dockerfile index 03b9993..86f739f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,6 @@ ARG BUILD_DATE ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -# environment settings -ENV PHP_MEMORY_LIMIT 512M -ENV MAX_UPLOAD 50M -ENV PHP_MAX_FILE_UPLOAD 200 -ENV PHP_MAX_POST 100M - # install packages RUN \ apk add --no-cache \ @@ -53,15 +47,6 @@ RUN \ tar \ wget && \ -# configure php - sed -i \ - -e "s|;*memory_limit =.*|memory_limit = ${PHP_MEMORY_LIMIT}|i" \ - -e "s|;*upload_max_filesize =.*|upload_max_filesize = ${MAX_UPLOAD}|i" \ - -e "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" \ - -e "s|;*post_max_size =.*|post_max_size = ${PHP_MAX_POST}|i" /etc/php5/php.ini \ - -e "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" \ - /etc/php5/php.ini && \ - # configure apache2 sed -i \ -e 's#User apache#User abc#g' \ diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md index 07c0a83..4cb7841 100644 --- a/READMETEMPLATE.md +++ b/READMETEMPLATE.md @@ -27,6 +27,7 @@ docker create \ -v :/config \ -v :/data \ -e PGID= -e PUID= \ + -e MAX_UPLOAD=<250M> \ -p 80:80 \ linuxserver/projectsend ``` @@ -45,6 +46,7 @@ http://192.168.x.x:8080 would show you what's running INSIDE the container on po * `-v /data` - where to store files to share. * `-e PGID` for GroupID - see below for explanation * `-e PUID` for UserID - see below for explanation +* `-e MAX_UPLOAD` to set maximum upload size , default if unset is 250M. It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it projectsend /bin/bash`. diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 797a695..efe6f1a 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -1,5 +1,18 @@ #!/usr/bin/with-contenv bash +PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-512M} +MAX_UPLOAD=${MAX_UPLOAD:-250M} +PHP_MAX_FILE_UPLOAD=${PHP_MAX_FILE_UPLOAD:-200} + +# configure php +sed -i \ + -e "s|;*memory_limit =.*|memory_limit = ${PHP_MEMORY_LIMIT}|i" \ + -e "s|;*upload_max_filesize =.*|upload_max_filesize = ${MAX_UPLOAD}|i" \ + -e "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" \ + -e "s|;*post_max_size =.*|post_max_size = ${MAX_UPLOAD}|i" \ + -e "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" \ + /etc/php5/php.ini + # create our folders mkdir -p \ /config/projectsend/images \