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:
2025-09-10 12:01:56 +02:00
parent 8ea4fc3fd3
commit 07cf999a9e
2 changed files with 6 additions and 5 deletions

View File

@@ -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..."

View File

@@ -1,8 +1,6 @@
services:
portfolio:
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/denshooter/my_portfolio:production
container_name: portfolio-app
restart: unless-stopped
ports: