parent
55938bbf46
commit
ef8e8f58a8
2 changed files with 39 additions and 0 deletions
@ -0,0 +1,20 @@ |
||||
FROM nginx |
||||
|
||||
WORKDIR /usr/share/nginx/html/ |
||||
USER root |
||||
|
||||
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf |
||||
|
||||
COPY ./dist /usr/share/nginx/html/ |
||||
|
||||
EXPOSE 80 |
||||
|
||||
CMD ["nginx", "-g", "daemon off;"] |
||||
|
||||
# 构建镜像 |
||||
|
||||
# docker build -t user-center-frontend:1.0 . |
||||
|
||||
# 运行容器 |
||||
|
||||
# docker run -p 80:80 -d user-center-frontend:1.0 |
@ -0,0 +1,19 @@ |
||||
server { |
||||
listen 80; |
||||
|
||||
# gzip config |
||||
gzip on; |
||||
gzip_min_length 1k; |
||||
gzip_comp_level 9; |
||||
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; |
||||
gzip_vary on; |
||||
gzip_disable "MSIE [1-6]\."; |
||||
|
||||
root /usr/share/nginx/html; |
||||
include /etc/nginx/mime.types; |
||||
|
||||
location / { |
||||
try_files $uri /index.html; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue