Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Docker Nginx
Commits
5dcb2fba
Commit
5dcb2fba
authored
Dec 25, 2023
by
xiaojun207
Browse files
优化部分脚本,升级版本
parent
e99510d1
Changes
3
Show whitespace changes
Inline
Side-by-side
Dockerfile
View file @
5dcb2fba
...
...
@@ -6,11 +6,12 @@ LABEL maintainer="xiaojun207 <xiaojun207@126.com>"
RUN
set
-ex
\
&&
apk upgrade
--update-cache
--available
\
&&
apk add bash openssl git
\
&&
git clone https://github.com/
neilpang
/acme.sh.git acme_src
\
&&
git clone https://github.com/
acmesh-official
/acme.sh.git acme_src
\
&&
cd
/acme_src
&&
./acme.sh
--install
--cert-home
/acme_cert
\
&&
apk del git
\
&&
rm
-rf
/acme_src /var/cache/apk/
*
\
&&
mkdir
-p
/etc/nginx/ssl/
&&
mkdir
-p
/etc/nginx/ssl/
\
&&
alias
acme.sh
=
~/.acme.sh/acme.sh
COPY
./nginx.conf /etc/nginx/nginx.conf
COPY
./default.conf /etc/nginx/conf.d/default.conf
...
...
build.sh
View file @
5dcb2fba
...
...
@@ -6,7 +6,7 @@ IMAGE=xiaojun207/nginx
# 版本信息来自nginx官方镜像
# https://hub.docker.com/_/nginx?tab=tags
NGINX_VERSIONS
=(
1.2
3.0
1.2
5.3
)
function
build
()
{
...
...
@@ -23,8 +23,8 @@ function build() {
TAG_LATEST
=
"
${
MAJOR
}
.
${
MINOR
}
"
TAG_SPECIAL
=
"
${
MAJOR
}
.
${
MINOR
}
.
${
PATCH
}
"
docker buildx build
\
--platform
linux/amd64,linux/arm64
\
#
--platform linux/amd64,linux/arm64
\
docker build
\
--build-arg
NGINX_VERSION
=
"
$NGINX_VERSION
"
\
--tag
$IMAGE
:
"latest"
\
--tag
$IMAGE
:
"
$TAG_LATEST
"
\
...
...
docker-entrypoint.sh
View file @
5dcb2fba
...
...
@@ -64,13 +64,13 @@ function StartAcmesh() {
/root/.acme.sh/acme.sh
--set-default-ca
--server
$SslServer
fi
echo
"[
$(
date
)
] acme.sh register .."
echo
"[
$(
date
)
]
1、
acme.sh register .."
/root/.acme.sh/acme.sh
--register-account
-m
$mail
echo
"[
$(
date
)
] acme.sh issue .."
echo
"[
$(
date
)
]
2、
acme.sh issue .."
/root/.acme.sh/acme.sh
--issue
--nginx
$ACME_DOMAIN_OPTION
--renew-hook
"
${
RELOAD_CMD
}
"
echo
"[
$(
date
)
] acme.sh install-cert .."
echo
"[
$(
date
)
]
3、
acme.sh install-cert .."
/root/.acme.sh/acme.sh
--install-cert
$ACME_DOMAIN_OPTION
\
--fullchain-file
${
SSL_DIR
}
/fullchain.pem
\
--cert-file
"
${
SSL_DIR
}
/cert.pem"
\
...
...
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