refactor(): move to wonderfall/nginx-php (possible fix #10)
This commit is contained in:
		
							
								
								
									
										27
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,36 +1,17 @@ | |||||||
| FROM alpine:3.6 | FROM wonderfall/nginx-php:7.1 | ||||||
|  |  | ||||||
| LABEL description "Rainloop is a simple, modern & fast web-based client" \ | LABEL description "Rainloop is a simple, modern & fast web-based client" \ | ||||||
|       maintainer="Hardware <contact@meshup.net>" |       maintainer="Hardware <contact@meshup.net>" | ||||||
|  |  | ||||||
| ARG GPG_FINGERPRINT="3B79 7ECE 694F 3B7B 70F3  11A4 ED7C 49D9 87DA 4591" | ARG GPG_FINGERPRINT="3B79 7ECE 694F 3B7B 70F3  11A4 ED7C 49D9 87DA 4591" | ||||||
|  |  | ||||||
| ENV UID=991 GID=991 UPLOAD_MAX_SIZE=25M | ENV UID=991 GID=991 UPLOAD_MAX_SIZE=25M MEMORY_LIMIT=128M | ||||||
|  |  | ||||||
| RUN echo "@community https://nl.alpinelinux.org/alpine/v3.6/community" >> /etc/apk/repositories \ | RUN apk -U upgrade \ | ||||||
|  && apk -U upgrade \ |  | ||||||
|  && apk add -t build-dependencies \ |  && apk add -t build-dependencies \ | ||||||
|     gnupg \ |     gnupg \ | ||||||
|     openssl \ |     openssl \ | ||||||
|     wget \ |     wget \ | ||||||
|  && apk add \ |  | ||||||
|     ca-certificates \ |  | ||||||
|     nginx \ |  | ||||||
|     s6 \ |  | ||||||
|     su-exec \ |  | ||||||
|     php7-fpm@community \ |  | ||||||
|     php7-curl@community \ |  | ||||||
|     php7-iconv@community \ |  | ||||||
|     php7-xml@community \ |  | ||||||
|     php7-dom@community \ |  | ||||||
|     php7-openssl@community \ |  | ||||||
|     php7-json@community \ |  | ||||||
|     php7-zlib@community \ |  | ||||||
|     php7-pdo_mysql@community \ |  | ||||||
|     php7-pdo_sqlite@community \ |  | ||||||
|     php7-sqlite3@community \ |  | ||||||
|     php7-ldap@community \ |  | ||||||
|     php7-simplexml@community \ |  | ||||||
|  && cd /tmp \ |  && cd /tmp \ | ||||||
|  && wget -q https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip \ |  && wget -q https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip \ | ||||||
|  && wget -q https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip.asc \ |  && wget -q https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip.asc \ | ||||||
| @@ -47,7 +28,7 @@ RUN echo "@community https://nl.alpinelinux.org/alpine/v3.6/community" >> /etc/a | |||||||
|  && rm -rf /tmp/* /var/cache/apk/* /root/.gnupg |  && rm -rf /tmp/* /var/cache/apk/* /root/.gnupg | ||||||
|  |  | ||||||
| COPY rootfs / | COPY rootfs / | ||||||
| RUN chmod +x /usr/local/bin/run.sh /services/*/run /services/.s6-svscan/* | RUN chmod +x /usr/local/bin/* /etc/s6.d/*/* /etc/s6.d/.s6-svscan/* | ||||||
| VOLUME /rainloop/data | VOLUME /rainloop/data | ||||||
| EXPOSE 8888 | EXPOSE 8888 | ||||||
| CMD ["run.sh"] | CMD ["run.sh"] | ||||||
|   | |||||||
| @@ -29,6 +29,7 @@ Rainloop is a simple, modern & fast web-based client. More details on the [offic | |||||||
| | **UID** | rainloop user id | *optional* | 991 | | **UID** | rainloop user id | *optional* | 991 | ||||||
| | **GID** | rainloop group id | *optional* | 991 | | **GID** | rainloop group id | *optional* | 991 | ||||||
| | **UPLOAD_MAX_SIZE** | Attachment size limit | *optional* | 25M | | **UPLOAD_MAX_SIZE** | Attachment size limit | *optional* | 25M | ||||||
|  | | **MEMORY_LIMIT** | Maximum amount of memory used by php | *optional* | 128M | ||||||
|  |  | ||||||
| ### Docker-compose.yml | ### Docker-compose.yml | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,78 +0,0 @@ | |||||||
| worker_processes auto; |  | ||||||
| pid /tmp/nginx.pid; |  | ||||||
| daemon off; |  | ||||||
|  |  | ||||||
| events { |  | ||||||
|   worker_connections 1024; |  | ||||||
|   use epoll; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| http { |  | ||||||
|   include /etc/nginx/mime.types; |  | ||||||
|   default_type  application/octet-stream; |  | ||||||
|  |  | ||||||
|   access_log off; |  | ||||||
|   error_log /tmp/ngx_error.log error; |  | ||||||
|  |  | ||||||
|   sendfile on; |  | ||||||
|   keepalive_timeout 15; |  | ||||||
|   keepalive_disable msie6; |  | ||||||
|   keepalive_requests 100; |  | ||||||
|   tcp_nopush on; |  | ||||||
|   tcp_nodelay on; |  | ||||||
|   server_tokens off; |  | ||||||
|  |  | ||||||
|   fastcgi_temp_path /tmp/fastcgi 1 2; |  | ||||||
|   client_body_temp_path /tmp/client_body 1 2; |  | ||||||
|   proxy_temp_path /tmp/proxy 1 2; |  | ||||||
|   uwsgi_temp_path /tmp/uwsgi 1 2; |  | ||||||
|   scgi_temp_path /tmp/scgi 1 2; |  | ||||||
|  |  | ||||||
|   gzip on; |  | ||||||
|   gzip_comp_level 5; |  | ||||||
|   gzip_min_length 512; |  | ||||||
|   gzip_buffers 4 8k; |  | ||||||
|   gzip_proxied any; |  | ||||||
|   gzip_vary on; |  | ||||||
|   gzip_disable "msie6"; |  | ||||||
|   gzip_types |  | ||||||
|     text/css |  | ||||||
|     text/javascript |  | ||||||
|     text/xml |  | ||||||
|     text/plain |  | ||||||
|     text/x-component |  | ||||||
|     application/javascript |  | ||||||
|     application/x-javascript |  | ||||||
|     application/json |  | ||||||
|     application/xml |  | ||||||
|     application/rss+xml |  | ||||||
|     application/vnd.ms-fontobject |  | ||||||
|     font/truetype |  | ||||||
|     font/opentype |  | ||||||
|     image/svg+xml; |  | ||||||
|  |  | ||||||
|   server { |  | ||||||
|     listen 8888; |  | ||||||
|     root /rainloop; |  | ||||||
|     index index.php; |  | ||||||
|     charset utf-8; |  | ||||||
|     client_max_body_size <UPLOAD_MAX_SIZE>; |  | ||||||
|  |  | ||||||
|     location ^~ /data { |  | ||||||
|       deny all; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     location / { |  | ||||||
|       try_files $uri $uri/ index.php; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     location ~* \.php$ { |  | ||||||
|       fastcgi_index index.php; |  | ||||||
|       fastcgi_pass unix:/tmp/php-fpm.sock; |  | ||||||
|       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |  | ||||||
|       include /etc/nginx/fastcgi_params; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|   } |  | ||||||
|  |  | ||||||
| } |  | ||||||
| @@ -1,14 +0,0 @@ | |||||||
| [global] |  | ||||||
| daemonize = no |  | ||||||
|  |  | ||||||
| [www] |  | ||||||
| listen = /tmp/php-fpm.sock |  | ||||||
| pm = dynamic |  | ||||||
| pm.max_children = 5 |  | ||||||
| pm.start_servers = 2 |  | ||||||
| pm.min_spare_servers = 1 |  | ||||||
| pm.max_spare_servers = 3 |  | ||||||
| chdir = / |  | ||||||
| php_admin_value[expose_php] = Off |  | ||||||
| php_admin_value[post_max_size] = <UPLOAD_MAX_SIZE> |  | ||||||
| php_admin_value[upload_max_filesize] = <UPLOAD_MAX_SIZE> |  | ||||||
							
								
								
									
										30
									
								
								rootfs/nginx/sites-enabled/rainloop.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								rootfs/nginx/sites-enabled/rainloop.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | server { | ||||||
|  |  | ||||||
|  |   listen 8888; | ||||||
|  |   root /rainloop; | ||||||
|  |   index index.php; | ||||||
|  |   charset utf-8; | ||||||
|  |  | ||||||
|  |   location ^~ /data { | ||||||
|  |     deny all; | ||||||
|  |     return 404; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   location / { | ||||||
|  |     try_files $uri $uri/ index.php; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   location ~* \.php$ { | ||||||
|  |     try_files $uri =404; | ||||||
|  |     include /nginx/conf/fastcgi_params; | ||||||
|  |     fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||||||
|  |     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||||||
|  |     fastcgi_param PATH_INFO $fastcgi_path_info; | ||||||
|  |     fastcgi_index index.php; | ||||||
|  |     fastcgi_pass unix:/php/run/php-fpm.sock; | ||||||
|  |     fastcgi_intercept_errors on; | ||||||
|  |     fastcgi_request_buffering off; | ||||||
|  |     fastcgi_param REMOTE_ADDR $http_x_real_ip; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -1,2 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
| exit 0 |  | ||||||
| @@ -1,2 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
| exec nginx |  | ||||||
| @@ -1,2 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
| exec php-fpm7 |  | ||||||
| @@ -1,10 +1,11 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| # Set attachment size limit | # Set attachment size and memory limit | ||||||
| sed -i "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /etc/php7/php-fpm.conf /etc/nginx/nginx.conf | sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /nginx/conf/nginx.conf /php/etc/php-fpm.conf \ | ||||||
|  |        -e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /php/etc/php-fpm.conf | ||||||
|  |  | ||||||
| # Fix permissions | # Fix permissions | ||||||
| chown -R $UID:$GID /rainloop/data /services /var/log /var/lib/nginx | chown -R $UID:$GID /rainloop/data /etc/s6.d /nginx /php /var/log | ||||||
|  |  | ||||||
| # RUN ! | # RUN ! | ||||||
| exec su-exec $UID:$GID /bin/s6-svscan /services | exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Hardware
					Hardware