# Define the compose file
DOCKER_COMPOSE = docker-compose -f docker-compose.yml

# Default target to run
.PHONY: all
all: run

# Build the containers
.PHONY: build
build:
	$(DOCKER_COMPOSE) build

# Run the containers in the background
.PHONY: run
run:
	$(DOCKER_COMPOSE) up -d

# Stop the containers
.PHONY: stop
stop:
	$(DOCKER_COMPOSE) down

# Clean up stopped containers and volumes
.PHONY: clean
clean:
	$(DOCKER_COMPOSE) down -v --remove-orphans

# View container logs
.PHONY: logs
logs:
	$(DOCKER_COMPOSE) logs -f

# Open a shell in the WordPress container
.PHONY: shell
shell:
	$(DOCKER_COMPOSE) exec wordpress bash