Files
peipei-backend/deploy-docker.sh
2025-09-07 17:21:47 -04:00

17 lines
544 B
Bash
Executable File

#!/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"