dockerfile
This commit is contained in:
parent
2c2efccb18
commit
9e539545b8
3 changed files with 87 additions and 0 deletions
15
docker/docker-init.sh
Normal file
15
docker/docker-init.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# clone and build blog
|
||||
cd /
|
||||
rm -rf /blog
|
||||
git clone https://github.com/kianby/blog.git
|
||||
cd /blog
|
||||
make
|
||||
|
||||
# nginx serve
|
||||
#nginx -g 'daemon off;'
|
||||
nginx
|
||||
|
||||
# exit on change in stacosys or Git repo
|
||||
python3 monitor.py
|
||||
42
docker/nginx.conf
Normal file
42
docker/nginx.conf
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile off;
|
||||
send_timeout 20;
|
||||
keepalive_timeout 60;
|
||||
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_min_length 512;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_vary on;
|
||||
gzip_comp_level 6;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
|
||||
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
root /blog/_site;
|
||||
index index.html;
|
||||
add_header Cache-Control "no-cache";
|
||||
|
||||
location /newcomment {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_pass http://stacosys:8100/newcomment;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue