Fix Docker deployment - use built image instead of building locally
- Change docker-compose.prod.yml to use ghcr.io image instead of building - Add --force-recreate flag to ensure new container is created - Add docker image prune to remove old images - This should fix the issue where old container version is served
This commit is contained in:
7
.github/workflows/ci-cd.yml
vendored
7
.github/workflows/ci-cd.yml
vendored
@@ -190,8 +190,11 @@ jobs:
|
||||
# Stop and remove old container
|
||||
docker compose -f $COMPOSE_FILE down || true
|
||||
|
||||
# Start new container
|
||||
docker compose -f $COMPOSE_FILE up -d
|
||||
# Remove old images to force using new one
|
||||
docker image prune -f
|
||||
|
||||
# Start new container with force recreate
|
||||
docker compose -f $COMPOSE_FILE up -d --force-recreate
|
||||
|
||||
# Wait for health check
|
||||
echo "Waiting for application to be healthy..."
|
||||
|
||||
Reference in New Issue
Block a user