mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:40:43 +00:00
use timestamp for image tag, remove volume mounts when starting container
This commit is contained in:
@@ -121,8 +121,8 @@ REMOTE_USER="openfront"
|
||||
REMOTE_UPDATE_PATH="/home/$REMOTE_USER"
|
||||
REMOTE_UPDATE_SCRIPT="$REMOTE_UPDATE_PATH/update-openfront.sh" # Where to place the script on server
|
||||
|
||||
IMAGE_NAME="${DOCKER_USERNAME}/${DOCKER_REPO}"
|
||||
DOCKER_IMAGE="${IMAGE_NAME}:${VERSION_TAG}"
|
||||
VERSION_TAG=$(date +"%Y%m%d-%H%M%S")
|
||||
DOCKER_IMAGE="${DOCKER_USERNAME}/${DOCKER_REPO}:${VERSION_TAG}"
|
||||
|
||||
# Check if update script exists
|
||||
if [ ! -f "$UPDATE_SCRIPT" ]; then
|
||||
@@ -145,7 +145,7 @@ echo "Git commit: $GIT_COMMIT"
|
||||
docker buildx build \
|
||||
--platform linux/amd64 \
|
||||
--build-arg GIT_COMMIT=$GIT_COMMIT \
|
||||
-t $DOCKER_USERNAME/$DOCKER_REPO:$VERSION_TAG \
|
||||
-t $DOCKER_IMAGE \
|
||||
--push \
|
||||
.
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ fi
|
||||
echo "Starting new container for ${HOST} environment..."
|
||||
docker run -d \
|
||||
--restart=always \
|
||||
$VOLUME_MOUNTS \
|
||||
--env-file /home/openfront/.env \
|
||||
--name ${CONTAINER_NAME} \
|
||||
$DOCKER_IMAGE
|
||||
@@ -52,8 +51,8 @@ if [ $? -eq 0 ]; then
|
||||
|
||||
# Final cleanup after successful deployment
|
||||
echo "Performing final cleanup of unused Docker resources..."
|
||||
echo "Removing unused images (not tagged and not referenced)..."
|
||||
docker image prune -f
|
||||
echo "Removing unused images (not referenced)..."
|
||||
docker image prune -a -f
|
||||
docker container prune -f
|
||||
echo "Cleanup complete."
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user