Improve docker build to use hooks
This commit is contained in:
69
docker/etc/nginx/nginx.conf
Normal file
69
docker/etc/nginx/nginx.conf
Normal file
@@ -0,0 +1,69 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
server_tokens off;
|
||||
access_log off;
|
||||
error_log /dev/stderr;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
index index.php;
|
||||
root /var/www/app;
|
||||
client_max_body_size 32M;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~* ^.+\.(log|sqlite)$ {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
|
||||
log_not_found off;
|
||||
expires 7d;
|
||||
etag on;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_comp_level 3;
|
||||
gzip_disable "msie6";
|
||||
gzip_vary on;
|
||||
gzip_types
|
||||
text/javascript
|
||||
application/javascript
|
||||
application/json
|
||||
text/xml
|
||||
application/xml
|
||||
application/rss+xml
|
||||
text/css
|
||||
text/plain;
|
||||
}
|
||||
}
|
||||
15
docker/etc/php7/conf.d/local.ini
Normal file
15
docker/etc/php7/conf.d/local.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
expose_php = Off
|
||||
error_reporting = E_ALL
|
||||
display_errors = Off
|
||||
log_errors = On
|
||||
error_log = /dev/stderr
|
||||
date.timezone = UTC
|
||||
allow_url_fopen = On
|
||||
post_max_size = 32M
|
||||
upload_max_filesize = 32M
|
||||
opcache.max_accelerated_files = 7963
|
||||
opcache.validate_timestamps = Off
|
||||
opcache.save_comments = 0
|
||||
opcache.load_comments = 0
|
||||
opcache.fast_shutdown = 1
|
||||
opcache.enable_file_override = On
|
||||
19
docker/etc/php7/php-fpm.conf
Normal file
19
docker/etc/php7/php-fpm.conf
Normal file
@@ -0,0 +1,19 @@
|
||||
[global]
|
||||
error_log = /proc/self/fd/2
|
||||
log_level = error
|
||||
daemonize = no
|
||||
|
||||
[www]
|
||||
catch_workers_output = yes
|
||||
user = nginx
|
||||
group = nginx
|
||||
listen.owner = nginx
|
||||
listen.group = nginx
|
||||
listen = /var/run/php-fpm.sock
|
||||
pm = dynamic
|
||||
pm.max_children = 20
|
||||
pm.start_servers = 1
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
pm.max_requests = 2048
|
||||
include = /etc/php7/php-fpm.d/env.conf
|
||||
2
docker/etc/services.d/.s6-svscan/finish
Executable file
2
docker/etc/services.d/.s6-svscan/finish
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
/bin/true
|
||||
3
docker/etc/services.d/nginx/run
Executable file
3
docker/etc/services.d/nginx/run
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/execlineb -P
|
||||
|
||||
nginx -g "daemon off;"
|
||||
2
docker/etc/services.d/php/run
Executable file
2
docker/etc/services.d/php/run
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/execlineb -P
|
||||
php-fpm7 -F
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
define('ENABLE_URL_REWRITE', true);
|
||||
define('LOG_DRIVER', 'stderr');
|
||||
6
docker/usr/local/bin/entrypoint.sh
Executable file
6
docker/usr/local/bin/entrypoint.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
chown -R nginx:nginx /var/www/app/data
|
||||
chown -R nginx:nginx /var/www/app/plugins
|
||||
|
||||
exec /bin/s6-svscan /etc/services.d
|
||||
Reference in New Issue
Block a user