-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 862 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (27 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.PHONY: all up down restart logs build run-scripts
# Default target
all: up run-scripts
up:
@if [ "$(shell docker ps -q -f name=php-webserver)" ]; then \
echo "Container is already running. Restarting..."; \
docker-compose restart; \
else \
echo "Container is not running. Building and starting..."; \
docker-compose up -d --build; \
fi
down:
-@docker-compose down || true
build:
docker-compose build
restart:
-@docker-compose down || true
docker-compose build
docker-compose up -d
logs:
tail -f logs/php_error.log logs/apache_error.log logs/apache_access.log
run-scripts:
@echo "Running all PHP scripts in the build-scripts directory..."
@for script in $$(ls build-scripts/*.php); do \
echo "Running $$script..."; \
docker exec php-webserver php /var/www/$$script | sed 's/.*php-webserver//' | grep -v "What's next"; \
done