-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·55 lines (46 loc) · 1.9 KB
/
makefile
File metadata and controls
executable file
·55 lines (46 loc) · 1.9 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ENV
DOCKER_COMP = docker compose
PHP = $(PHP_CONT) php
PHP_CONT = $(DOCKER_COMP) exec --user=robbyte frankenphp
## Initialize containers
init:
rm -f src/.gitkeep
docker network inspect apps >/dev/null 2>&1 || docker network create apps;
@$(DOCKER_COMP) build --pull --no-cache;
@$(DOCKER_COMP) up --detach;
## Docker
rebuild: ## Builds the Docker images (no cache)
@$(DOCKER_COMP) build --pull --no-cache
@$(DOCKER_COMP) up --detach
reload: ## Builds the Docker images
@$(DOCKER_COMP) build
@$(DOCKER_COMP) up --detach
up: ## Start the docker hub in detached mode (no logs)
@$(DOCKER_COMP) up --detach
down: ## Stop the docker hub
@$(DOCKER_COMP) down --remove-orphans
logs: ## Show live logs
@$(DOCKER_COMP) logs --tail=0 --follow
php: ## Open shell in FrankenPHP container
@$(PHP_CONT) bash
setup-githooks:
git config core.hooksPath .githooks
chmod +x .githooks/pre-commit
trust-cert: ## Trust Caddy's local CA certificate (Fedora/Debian)
@echo "Extracting Caddy root CA certificate..."
@$(DOCKER_COMP) exec frankenphp cat /data/caddy/pki/authorities/local/root.crt > /tmp/caddy-root.crt 2>/dev/null || (echo "Error: Failed to extract certificate. Is FrankenPHP running?" && exit 1)
@if command -v update-ca-certificates >/dev/null 2>&1; then \
echo "Detected Debian/Ubuntu-based system..."; \
sudo cp /tmp/caddy-root.crt /usr/local/share/ca-certificates/caddy-root.crt; \
sudo update-ca-certificates; \
elif command -v update-ca-trust >/dev/null 2>&1; then \
echo "Detected Fedora/RHEL-based system..."; \
sudo cp /tmp/caddy-root.crt /etc/pki/ca-trust/source/anchors/caddy-root.crt; \
sudo update-ca-trust extract; \
else \
echo "Error: Could not detect certificate management tool."; \
echo "Please manually install /tmp/caddy-root.crt into your system trust store."; \
exit 1; \
fi
@echo "Certificate trusted successfully. Restart Chrome: chrome://restart"
@rm -f /tmp/caddy-root.crt