1. 更新前端界面和Nginx配置
2. 更新Dockerfile设置
This commit is contained in:
8
docker-nginx/Dockerfile
Normal file
8
docker-nginx/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM protection_ubuntu:latest
|
||||
LABEL authors="Endera"
|
||||
|
||||
COPY realtime_protection realtime_protection
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["bash", "realtime_protection/docker-nginx/start_nginx.sh"]
|
||||
4
docker-nginx/Dockerfile.dockerignore
Normal file
4
docker-nginx/Dockerfile.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
../build
|
||||
../.gradle
|
||||
../gradle
|
||||
../log
|
||||
17
docker-nginx/prepare_nginx.sh
Normal file
17
docker-nginx/prepare_nginx.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 初始化变量设定
|
||||
export set BASEDIR="/root"
|
||||
export set PROTECTION_DIR="$BASEDIR/realtime_protection"
|
||||
export set PROTECTION_NGINX_DIR="$PROTECTION_DIR/src/main/resources/nginx"
|
||||
export set PROJECT_NGINX_DIR="$BASEDIR/nginx"
|
||||
export set GLOBAL_NGINX_DIR="/etc/nginx"
|
||||
|
||||
# 下载git仓库内容
|
||||
echo https://EnderByEndera:8Bs8hxHtE-iq44g@git.mesalab.cn > $BASEDIR/.git-credentials
|
||||
git config --global credential.helper store
|
||||
git clone https://git.mesalab.cn/EnderByEndera/realtime_protection.git $BASEDIR/realtime_protection
|
||||
|
||||
# 拷贝Nginx配置到指定地址
|
||||
cp -r $PROTECTION_NGINX_DIR $BASEDIR
|
||||
cp $PROTECTION_NGINX_DIR/nginx.conf $GLOBAL_NGINX_DIR
|
||||
18
docker-nginx/start_nginx.sh
Normal file
18
docker-nginx/start_nginx.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 初始化变量设定
|
||||
export set BASEDIR="/root"
|
||||
export set PROTECTION_DIR="$BASEDIR/realtime_protection"
|
||||
export set PROTECTION_NGINX_DIR="$PROTECTION_DIR/src/main/resources/nginx"
|
||||
export set PROJECT_NGINX_DIR="$BASEDIR/nginx"
|
||||
export set GLOBAL_NGINX_DIR="/etc/nginx"
|
||||
|
||||
# 拷贝Nginx配置到指定地址
|
||||
cp -r $PROTECTION_NGINX_DIR $BASEDIR
|
||||
cp $PROTECTION_NGINX_DIR/nginx.conf $GLOBAL_NGINX_DIR
|
||||
|
||||
# 启动Nginx服务
|
||||
service nginx start
|
||||
|
||||
# 控制Docker容器挂起
|
||||
top -b
|
||||
Reference in New Issue
Block a user