-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 2.13 KB
/
Copy pathMakefile
File metadata and controls
58 lines (44 loc) · 2.13 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
56
57
58
# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Netresearch DTT GmbH
IMAGE ?= ghcr.io/netresearch/phpmyadmin-php-fpm
TAG ?= local
PMA_VERSION ?= $(shell cat .phpmyadmin-version)
PHP_VERSION ?= 8.4
COMPOSE := docker compose
.PHONY: help build build-rolling up up-standalone down logs shell lint test scan clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
build: ## Build the pinned image
docker build -t $(IMAGE):$(TAG) \
--build-arg PHP_VERSION=$(PHP_VERSION) \
--build-arg PMA_VERSION=$(PMA_VERSION) .
build-rolling: ## Build with refreshed PHP libraries
docker build -t $(IMAGE):$(TAG)-rolling \
--build-arg PHP_VERSION=$(PHP_VERSION) \
--build-arg PMA_VERSION=$(PMA_VERSION) \
--build-arg ROLLING_DEPS=true .
up: ## Start app + web against an existing database (set PMA_HOST)
$(COMPOSE) up -d app-assets app web
up-standalone: ## Start everything including a demo MariaDB
$(COMPOSE) --profile standalone up -d --wait
down: ## Stop the stack
$(COMPOSE) --profile standalone down
logs: ## Follow the logs
$(COMPOSE) logs -f
shell: ## Shell in the app container
$(COMPOSE) exec app bash
lint: ## hadolint + compose validation + shellcheck
docker run --rm -i hadolint/hadolint hadolint --config - - < .hadolint.yaml < Dockerfile || \
docker run --rm -v $(PWD):/w -w /w hadolint/hadolint hadolint Dockerfile
$(COMPOSE) config -q
docker run --rm -v $(PWD):/w -w /w koalaman/shellcheck:stable rootfs/usr/local/bin/entrypoint.sh
test: build ## Build, then run the container-structure tests
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD)/tests:/tests \
gcr.io/gcp-runtimes/container-structure-test:latest \
test --image $(IMAGE):$(TAG) --config /tests/container-structure-test.yaml
scan: build ## Scan the built image for known vulnerabilities
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
aquasec/trivy:latest image --scanners vuln --ignore-unfixed $(IMAGE):$(TAG)
clean: ## Remove the stack including its volumes
$(COMPOSE) --profile standalone down -v