Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
38227877
Commit
38227877
authored
Jan 08, 2020
by
Junling Bu
Browse files
docker调整
parent
d2ff854e
Changes
4
Hide whitespace changes
Inline
Side-by-side
docker/bin/deploy.sh
0 → 100644
View file @
38227877
#!/bin/bash
cd
/home/ubuntu/docker
sudo
docker-compose down
sudo
docker-compose build
sudo
docker image prune
-f
sudo
docker-compose up
-d
docker/bin/reset.sh
0 → 100644
View file @
38227877
#!/bin/bash
# 本脚本的作用是重置部署环境
# 1.重置数据库
# 2.删除storage文件夹内文件
# 3.调用deploy.sh启动服务
# 注意:由于1和2的原因,请仅在开发测试阶段使用本脚本!
# 重置数据库
# i. 请在`XXXXXX`处设置相应的root密码
# ii. 同时请注意root密码放在脚本是非常危险的,因此这里仅仅是用于开发测试阶段。
ROOT
=
root
PASSWORD
=
litemall123456
if
test
-z
"
$PASSWORD
"
then
echo
"请设置云服务器MySQL的root账号密码"
exit
1
fi
# 删除storage文件夹内文件
cd
/home/ubuntu/docker/litemall/storage
||
exit
2
sudo rm
-f
./
**
cd
/home/ubuntu/docker
||
exit
3
sudo
docker-compose down
sudo
docker-compose build
sudo
docker image prune
-f
# 删除db/data文件夹内文件重置数据
# 这样docker启动时会自动运行db/init-sql脚本,导入新的数据
cd
/home/ubuntu/docker/db/data
||
exit
1
sudo rm
-rf
./
**
cd
/home/ubuntu/docker
||
exit
3
sudo
docker-compose up
-d
docker/litemall/Dockerfile
View file @
38227877
FROM
openjdk:8-jre
COPY
application.yml
/litemall/
application.yml
COPY
litemall.jar
/litemall/
litemall.jar
COPY
application.yml application.yml
COPY
litemall.jar litemall.jar
ENTRYPOINT
["java","-Djava.security.egd=file:/dev/./urandom","-jar","litemall.jar"]
\ No newline at end of file
docker/util/lazy.sh
View file @
38227877
...
...
@@ -7,10 +7,10 @@
# 请设置云服务器的IP地址和账户
# 例如 ubuntu@122.51.199.160
REMOTE
=
REMOTE
=
ubuntu@122.51.199.160
# 请设置本地SSH私钥文件id_rsa路径
# 例如 /home/litemall/id_rsa
ID_RSA
=
ID_RSA
=
/d/00/cloud/litemall.txt
if
test
-z
"
$REMOTE
"
then
...
...
@@ -38,8 +38,8 @@ cd $LITEMALL_HOME || exit 2
scp
-i
$ID_RSA
-r
./docker
$REMOTE
:/home/ubuntu/
# 远程登录云服务器并执行reset脚本
#ssh $REMOTE -i $ID_RSA << eeooff
#cd /home/ubuntu
#sudo ./docker/bin/reset.sh
#exit
#eeooff
\ No newline at end of file
ssh
$REMOTE
-i
$ID_RSA
<<
eeooff
cd /home/ubuntu
sudo ./docker/bin/reset.sh
exit
eeooff
\ No newline at end of file
Write
Preview
Supports
Markdown
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