Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qg-dockerfiles
Commits
d4bfc8f2
Commit
d4bfc8f2
authored
Apr 08, 2020
by
zhijie.xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加ui生产镜像
parent
2354fe3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
162 additions
and
0 deletions
+162
-0
Dockerfile
production/ui/Dockerfile
+23
-0
default.conf
production/ui/default.conf
+71
-0
nginx.conf
production/ui/nginx.conf
+68
-0
No files found.
production/ui/Dockerfile
0 → 100644
View file @
d4bfc8f2
# 如果需要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/
production/ui/default.conf
0 → 100644
View file @
d4bfc8f2
# 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
30
d
;
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
/
50
x
.
html
;
location
= /
50
x
.
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
production/ui/nginx.conf
0 → 100644
View file @
d4bfc8f2
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment