Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
吴迪
gs1
Commits
4ce384aa
Commit
4ce384aa
authored
Sep 26, 2021
by
Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 打包镜像
parent
2e72bbdc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
0 deletions
+63
-0
Dockerfile
Dockerfile
+11
-0
build.sh
build.sh
+24
-0
docker-entrypoint.sh
docker-entrypoint.sh
+3
-0
nginx.conf
nginx.conf
+25
-0
No files found.
Dockerfile
0 → 100644
View file @
4ce384aa
FROM
nginx
RUN
rm
-rf
/usr/share/nginx/html/
*
RUN
rm
-rf
/etc/nginx/conf.d/
*
COPY
dist /usr/share/nginx/html
COPY
nginx.conf /etc/nginx/conf.d/
COPY
docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT
["sh","/usr/local/bin/docker-entrypoint.sh"]
build.sh
0 → 100755
View file @
4ce384aa
#!/bin/bash
REGISTRY_URL
=
"registry.cn-hangzhou.aliyuncs.com"
NAME_SPACE
=
"ksami"
BUILD_TAG
=
"1.0"
IMAGE_NAME
=
"gs1cn_front"
if
[
"
$1
"
!=
""
]
;
then
BUILD_TAG
=
"
$1
"
fi
REGISTRY_URL
=
"registry.cn-hangzhou.aliyuncs.com"
docker login
--username
=
$DOCKER_REPO_USERNAME
$REGISTRY_URL
--password
=
$DOCKER_REPO_PASSWORD
set
-e
docker build
-t
$IMAGE_NAME
:
$BUILD_TAG
.
docker tag
$IMAGE_NAME
:
$BUILD_TAG
$REGISTRY_URL
/
$NAME_SPACE
/
$IMAGE_NAME
:
$BUILD_TAG
docker push
$REGISTRY_URL
/
$NAME_SPACE
/
$IMAGE_NAME
:
$BUILD_TAG
docker rmi
$IMAGE_NAME
:
$BUILD_TAG
docker rmi
$REGISTRY_URL
/
$NAME_SPACE
/
$IMAGE_NAME
:
$BUILD_TAG
docker-entrypoint.sh
0 → 100644
View file @
4ce384aa
#!/bin/sh
chmod
-R
777 /usr/share/nginx/html
nginx
-g
'daemon off;'
nginx.conf
0 → 100644
View file @
4ce384aa
# 开启gzip
gzip
on
;
# 启用gzip压缩的最小文件,小于设置值的文件将不会压缩
gzip_min_length
1k
;
# gzip 压缩级别,1-10,数字越大压缩的越好,也越占用CPU时间,后面会有详细说明
gzip_comp_level
5
;
# 进行压缩的文件类型。javascript有多种形式。其中的值可以在 mime.types 文件中找到。
gzip_types
text/plain
application/javascript
application/x-javascript
text/css
application/xml
text/javascript
application/x-httpd-php
image/jpeg
image/gif
image/png
font/ttf
font/otf
image/svg
+xml
;
# 是否在http header中添加Vary: Accept-Encoding,建议开启
gzip_vary
on
;
# 禁用IE 6 gzip
gzip_disable
"MSIE
[1-6]
\
."
;
server
{
listen
8088
;
server_name
81
.68.189.225
;
location
/
{
root
/usr/share/nginx/html
;
index
index.html
index.htm
;
if
(!-e
$request_filename
)
{
rewrite
^/(.*)
/index.html
last
;
break
;
}
}
}
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