feat: 新增docker部署脚本
This commit is contained in:
16
deploy-docker.sh
Executable file
16
deploy-docker.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Docker deployment script
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Get current time and format it
|
||||||
|
current_time=$(date +"%Y-%m-%d %H:%M:%S")
|
||||||
|
echo "Deployment started at: $current_time"
|
||||||
|
|
||||||
|
echo "Connecting to server to update docker container..."
|
||||||
|
# SSH into the server, pull the latest image and restart the container
|
||||||
|
ssh root@122.51.20.105 "source /etc/profile; cd ~; docker compose pull && docker compose up -d"
|
||||||
|
echo "Docker container updated!"
|
||||||
|
|
||||||
|
# Get current time and format it
|
||||||
|
current_time=$(date +"%Y-%m-%d %H:%M:%S")
|
||||||
|
echo "Deployment finished at: $current_time"
|
||||||
Reference in New Issue
Block a user