Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docker-test
Project
Project
Details
Activity
Releases
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
Kunkka王辉
docker-test
Commits
e3977931
Commit
e3977931
authored
Sep 20, 2023
by
Kunkka王辉
😲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档编写
parent
eade8781
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
4 deletions
+91
-4
README.md
README.md
+8
-0
docker-compose.yaml
docker-compose.yaml
+2
-1
install.sh
install.sh
+78
-0
nginx-start.sh
src/nginx-start.sh
+3
-3
No files found.
README.md
View file @
e3977931
## galaxy-开发/测试环境 docker-compose
## Get Start
```
# 安装dev环境到本地
curl http://192.168.11.163/demo/install.sh | bash -s dev
```
## services
1.
php7
2.
nginx
...
...
docker-compose.yaml
View file @
e3977931
...
...
@@ -141,3 +141,4 @@ networks:
volumes
:
maven-repo
:
name
:
maven-repo
external
:
true
\ No newline at end of file
install.sh
0 → 100644
View file @
e3977931
#!/bin/bash
OS_IS_LINUX
=
'yes'
;
if
[
$(
uname
-o
)
!=
"GNU/Linux"
]
;
then
OS_IS_LINUX
=
'no'
;
fi
DOCKER_YES
=
'yes'
;
if
[
!
`
command
-v
docker
`
]
;
then
DOCKER_YES
=
'no'
;
fi
;
GIT_YES
=
'yes'
;
if
[
!
`
command
-v
git
`
]
;
then
DOCKER_YES
=
'no'
;
fi
;
TAR_YES
=
'yes'
;
if
[
!
`
command
-v
tar
`
]
;
then
DOCKER_YES
=
'no'
;
fi
;
COMPOSE_CMD
=
'docker-compose'
if
docker
--help
|
grep
compose
>
/dev/null
;
then
COMPOSE_CMD
=
'docker compose'
fi
DOCKER_COMPOSE_YES
=
'yes'
;
if
[
!
`
command
-v
docker-compose
`
]
&&
[
"
$COMPOSE_CMD
"
!=
'docker compose'
]
;
then
DOCKER_COMPOSE_YES
=
'no'
;
fi
;
PORT_YES
=
'yes'
;
if
ss
-tpl
|
grep
-E
'8118|8181'
>
/dev/null
;
then
PORT_YES
=
'no'
;
fi
;
cat
<<
EOF
检查环境:
1. 是否是linux系统
$OS_IS_LINUX
2. docker
$DOCKER_YES
3. git
$GIT_YES
4. docker-compose/docker compose
$DOCKER_COMPOSE_YES
5. tar
$TAR_YES
6. 端口8118,8181是否可用
$PORT_YES
EOF
if
echo
"
$TAR_YES$GIT_YES$DOCKER_COMPOSE_YES$OS_IS_LINUX$DOCKER_YES$PORT_YES
"
|
grep
no
>
/dev/null
;
then
exit
;
fi
echo
$@
# 变量声明
ENV
=
'dev'
CODE_DIR
=
$(
pwd
)
/code-
$ENV
for
arg
in
"
$@
"
;
do
if
[
-n
"
$arg
"
]
;
then
ENV
=
"
$arg
"
break
fi
done
BUILD_DIR
=
galaxy-
$ENV
if
[
!
-d
$CODE_DIR
]
;
then
mkdir
-p
$CODE_DIR
fi
cd
$CODE_DIR
echo
"下载demo代码"
curl
-o
data.tgz -# http://192.168.11.163/demo/code-demo-920.tgz
echo
'解压缩......'
tar
--strip-components
=
1
-xf
data.tgz
rm
-f
data.tgz
echo
'下载compose项目'
cd
../
# 到上一层
git clone git@gitlab.galaxy-immi.com:kunkka.wh/docker-test.git
$BUILD_DIR
cd
$BUILD_DIR
cat
<<
EOF
> .env
# 环境变量env dev,test,test1,test2等区分
ENV=
$ENV
# 服务宿主机的端口
PORT=8118
PORT_CRM=8181
# 代码目录,含前后端
CODE_DIR=
$CODE_DIR
JAVA_PROFILE=innerdev # java需要根据环境调整
#nacos 客户端轮询间隔
TICK_TIME=30000
EOF
echo
'生成.env文件'
cat
.env
echo
'启动容器,检查端口是否占用'
if
ss
-t
$COMPOSE_CMD
up
-d
cat
<<
EOF
本地访问地址
http://本机ip:8118/
http://本机ip:8181/
安装完成!
EOF
# xxx:1234/
# xxx:3322/
src/nginx-start.sh
View file @
e3977931
...
...
@@ -182,9 +182,9 @@ server {
location ^~ /subapp/userInfo/ {
proxy_pass http://
$HOST
:
$VUE_USERINFO_PORT
/;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header Host
$host
;
proxy_set_header X-Real-Ip
$remote_addr
;
proxy_set_header X-Forwarded-For
\
$proxy_add_x_forwarded_for
;
proxy_set_header Host
\
$host
;
proxy_set_header X-Real-Ip
\
$remote_addr
;
proxy_set_header X-Ngnix-Proxy true;
}
...
...
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