init project
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
# 查看更多 .gitignore 配置 -> https://help.github.com/articles/ignoring-files/
|
||||||
|
/agt/jar/agt-server.jar
|
||||||
|
/nginx/html/dist/
|
||||||
15
agt/dockerfile
Normal file
15
agt/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:17
|
||||||
|
# author
|
||||||
|
MAINTAINER agt
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/agt
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/agt
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/agt
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/agt-server.jar /home/agt/agt-server.jar
|
||||||
|
# 启动系统服务
|
||||||
|
ENTRYPOINT ["java","-jar","agt-server.jar"]
|
||||||
1
agt/jar/readme.txt
Normal file
1
agt/jar/readme.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||||
65
docker-compose.yml
Normal file
65
docker-compose.yml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
version : '3.8'
|
||||||
|
services:
|
||||||
|
agt-mysql:
|
||||||
|
container_name: agt-mysql
|
||||||
|
image: mysql:5.7
|
||||||
|
build:
|
||||||
|
context: ./mysql
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
volumes:
|
||||||
|
- ./mysql/conf:/etc/mysql/conf.d
|
||||||
|
- ./mysql/logs:/logs
|
||||||
|
- ./mysql/data:/var/lib/mysql
|
||||||
|
command: [
|
||||||
|
'mysqld',
|
||||||
|
'--innodb-buffer-pool-size=80M',
|
||||||
|
'--character-set-server=utf8mb4',
|
||||||
|
'--collation-server=utf8mb4_unicode_ci',
|
||||||
|
'--default-time-zone=+8:00',
|
||||||
|
'--lower-case-table-names=1'
|
||||||
|
]
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: 'agt-cloud'
|
||||||
|
MYSQL_ROOT_PASSWORD: 123456
|
||||||
|
agt-redis:
|
||||||
|
container_name: agt-redis
|
||||||
|
image: redis
|
||||||
|
build:
|
||||||
|
context: ./redis
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- ./redis/conf/redis.conf:/home/agt/redis/redis.conf
|
||||||
|
- ./redis/data:/data
|
||||||
|
command: redis-server /home/agt/redis/redis.conf
|
||||||
|
agt-nginx:
|
||||||
|
container_name: agt-nginx
|
||||||
|
image: nginx
|
||||||
|
build:
|
||||||
|
context: ./nginx
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/html/dist:/home/agt/html
|
||||||
|
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
||||||
|
- ./nginx/logs:/var/log/nginx
|
||||||
|
- ./nginx/conf.d:/etc/nginx/conf.d
|
||||||
|
agt-server:
|
||||||
|
container_name: agt-server
|
||||||
|
build:
|
||||||
|
context: ./agt
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "48080:48080"
|
||||||
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=test
|
||||||
|
depends_on:
|
||||||
|
- agt-redis
|
||||||
|
- agt-mysql
|
||||||
|
volumes:
|
||||||
|
- /usr/local/licGen/log/:/usr/local/licGen/log/
|
||||||
|
links:
|
||||||
|
- agt-redis
|
||||||
|
- agt-mysql
|
||||||
|
|
||||||
1
mysql/db/readme.txt
Normal file
1
mysql/db/readme.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>sqlĿ¼<EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>нű<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD>Զ<EFBFBD>ִ<EFBFBD>С<EFBFBD>
|
||||||
7
mysql/dockerfile
Normal file
7
mysql/dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# 基础镜像
|
||||||
|
FROM mysql:5.7
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 执行sql脚本
|
||||||
|
#ADD ./db/*.sql /docker-entrypoint-initdb.d/
|
||||||
41
nginx/conf/nginx.conf
Normal file
41
nginx/conf/nginx.conf
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /home/agt/html;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /admin-api {
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header REMOTE-HOST $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_pass http://192.168.9.50:48080/admin-api;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 避免actuator暴露
|
||||||
|
if ($uri ~ "/actuator") {
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
nginx/dockerfile
Normal file
15
nginx/dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# 基础镜像
|
||||||
|
FROM nginx
|
||||||
|
# author
|
||||||
|
MAINTAINER agt
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/agt/html
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/agt/html
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/agt/html
|
||||||
|
# 复制conf文件到路径
|
||||||
|
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
# 复制html文件到路径
|
||||||
|
COPY ./html/dist /home/agt/html
|
||||||
1
nginx/html/readme.txt
Normal file
1
nginx/html/readme.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>
|
||||||
1
redis/conf/redis.conf
Normal file
1
redis/conf/redis.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# requirepass 123456
|
||||||
13
redis/dockerfile
Normal file
13
redis/dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# 基础镜像
|
||||||
|
FROM redis
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi/redis
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi/redis
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi/redis
|
||||||
|
# 复制conf文件到路径
|
||||||
|
COPY ./conf/redis.conf /home/ruoyi/redis/redis.conf
|
||||||
46
start.sh
Normal file
46
start.sh
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -z "$2"] && branch='main' || branch=$2
|
||||||
|
|
||||||
|
# 使用说明,用来提示输入参数
|
||||||
|
usage() {
|
||||||
|
echo "Usage: sh start.sh [system|user|auth]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
common(){
|
||||||
|
cd ..
|
||||||
|
git checkout $branch
|
||||||
|
git pull
|
||||||
|
mvn clean package -Dmaven.test.skip=true -P test
|
||||||
|
cd docker
|
||||||
|
}
|
||||||
|
|
||||||
|
# 启动程序模块(必须)
|
||||||
|
backend(){
|
||||||
|
echo "begin copy agt-server "
|
||||||
|
sudo docker stop agt-server
|
||||||
|
sudo docker rm agt-server
|
||||||
|
sudo docker rmi deploy_agt-server
|
||||||
|
docker-compose up -d agt-server
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# 根据输入参数,选择执行对应方法,不输入则执行使用说明
|
||||||
|
case "$1" in
|
||||||
|
"backend")
|
||||||
|
backend
|
||||||
|
;;
|
||||||
|
"user")
|
||||||
|
user
|
||||||
|
;;
|
||||||
|
"stop")
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
"rm")
|
||||||
|
rm
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user