Commit d4bfc8f2 authored by zhijie.xue's avatar zhijie.xue

增加ui生产镜像

parent 2354fe3f
# 如果需要luarocks,需要改用fat镜像
FROM openresty/openresty:1.15.8.3-1-alpine
# 修复时区显示问题
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& apk add tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata \
&& chown nobody /home \
&& chown nobody /var/run/openresty
# 使用非root用户启动nginx
USER nobody
RUN mkdir -p /home/quant_group/dist \
&& mkdir /home/quant_group/logs \
&& touch /home/quant_group/logs/error.log /home/quant_group/logs/access.log \
# 拷贝默认文件,避免代码存放不当导致循环请求异常
&& cp /usr/local/openresty/nginx/html/index.html /home/quant_group/dist
COPY nginx.conf /usr/local/openresty/nginx/conf/
COPY default.conf /etc/nginx/conf.d/
# nginx.vh.default.conf -- docker-openresty
#
# This file is installed to:
# `/etc/nginx/conf.d/default.conf`
#
# It tracks the `server` section of the upstream OpenResty's `nginx.conf`.
#
# This config (and any other configs in `etc/nginx/conf.d/`) is loaded by
# default by the `include` directive in `/usr/local/openresty/nginx/conf/nginx.conf`.
#
# See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files
#
server {
listen 8000;
server_name _;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location = /favicon.ico {
access_log off;
log_not_found off;
root /home/quant_group/dist;
try_files $uri $uri/ =204;
}
location ~* \.(css|js|png|gif|jpg|jpeg|ttf|woff|woff2|json)$ {
expires 30d;
root /home/quant_group/dist;
}
location / {
expires -1;
root /home/quant_group/dist;
try_files $uri $uri/ /index.html?$query_string;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/openresty/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root /usr/local/openresty/nginx/html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
\ No newline at end of file
# nginx.conf -- docker-openresty
#
# This file is installed to:
# `/usr/local/openresty/nginx/conf/nginx.conf`
# and is the file loaded by nginx at startup,
# unless the user specifies otherwise.
#
# It tracks the upstream OpenResty's `nginx.conf`, but removes the `server`
# section and adds this directive:
# `include /etc/nginx/conf.d/*.conf;`
#
# The `docker-openresty` file `nginx.vh.default.conf` is copied to
# `/etc/nginx/conf.d/default.conf`. It contains the `server section
# of the upstream `nginx.conf`.
#
# See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files
#
#user nobody;
worker_processes 1;
#error_log logs/error.log;
error_log /home/quant_group/logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/openresty/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '{"logtime":"$time_iso8601","hostname":"$hostname","proto":"$http_x_forwarded_proto","request":"$request","host":"$host","status":"$status","httpReferer":"$http_referer","original_client_ip":"$http_x_original_client_ip","forwarded_for":"$http_x_forwarded_for","remote_addr":"$remote_addr","responseTime":"$request_time",,"userAgent":"$http_user_agent","bodySize":"$body_bytes_sent"';
access_log /home/quant_group/logs/access.log main;
# See Move default writable paths to a dedicated directory (#119)
# https://github.com/openresty/docker-openresty/issues/119
client_body_temp_path /var/run/openresty/nginx-client-body;
proxy_temp_path /var/run/openresty/nginx-proxy;
fastcgi_temp_path /var/run/openresty/nginx-fastcgi;
uwsgi_temp_path /var/run/openresty/nginx-uwsgi;
scgi_temp_path /var/run/openresty/nginx-scgi;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript;
gzip_disable msie6;
gzip_vary on;
server_tokens off;
include /etc/nginx/conf.d/*.conf;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment