Add Nginx and Supervisor configurations for Docker environment
This commit is contained in:
parent
d6b5f0409c
commit
d2f992493d
|
|
@ -0,0 +1,64 @@
|
|||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/xml
|
||||
text/javascript
|
||||
application/json
|
||||
application/javascript
|
||||
application/xml+rss
|
||||
application/atom+xml
|
||||
image/svg+xml;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /app/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
client_max_body_size 35M;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
error_page 404 /index.php;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
[unix_http_server]
|
||||
file=/var/run/supervisor.sock
|
||||
chmod=0700
|
||||
|
||||
[supervisord]
|
||||
logfile=/var/log/supervisord.log
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=info
|
||||
pidfile=/var/run/supervisord.pid
|
||||
nodaemon=true
|
||||
minfds=1024
|
||||
minprocs=200
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///var/run/supervisor.sock
|
||||
|
||||
[program:nginx]
|
||||
command=nginx -g "daemon off;"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/nginx.log
|
||||
stderr_logfile=/var/log/nginx.log
|
||||
|
||||
[program:php-fpm]
|
||||
command=php-fpm -F
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/php-fpm.log
|
||||
stderr_logfile=/var/log/php-fpm.log
|
||||
|
||||
[program:memcached]
|
||||
command=memcached -u www-data -m 64 -p 11211 -l 127.0.0.1 -v
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/memcached.log
|
||||
stderr_logfile=/var/log/memcached.log
|
||||
|
||||
[program:redis]
|
||||
command=redis-server --bind 127.0.0.1 --port 6379 --daemonize no
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/redis.log
|
||||
stderr_logfile=/var/log/redis.log
|
||||
|
||||
# [program:horizon]
|
||||
# process_name=%(program_name)s
|
||||
# command=php /app/artisan horizon
|
||||
# autostart=true
|
||||
# autorestart=true
|
||||
# redirect_stderr=true
|
||||
# stdout_logfile=/var/log/horizon.log
|
||||
# stopwaitsecs=3600
|
||||
Loading…
Reference in New Issue