-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
59 lines (54 loc) · 1.82 KB
/
Makefile
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
59
all: fix build-n-push
php-cs-fixer:
docker run --rm -v $(shell pwd):/data cytopia/php-cs-fixer fix
fix: php-cs-fixer
image_reference_devel:=ghcr.io/benzine-framework/bouncer:devel
build-n-push: fix
docker build \
--build-arg BUILD_DATE="$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--build-arg GIT_SHA="$(shell git rev-parse HEAD)" \
--build-arg GIT_BUILD_ID="$(shell git rev-parse --abbrev-ref HEAD)-$(shell git describe --tags --dirty --always | sed -e 's/^v//')" \
--build-arg GIT_COMMIT_MESSAGE="$(shell git log -1 --pretty=%B | head -n1)" \
--build-context php:cli=docker-image://ghcr.io/benzine-framework/php:cli-8.2 \
--tag benzine/bouncer \
--tag $(image_reference_devel) \
--target bouncer \
--progress plain \
.
docker push $(image_reference_devel)
test-as-service: clean
docker build -t bouncer --target bouncer .
docker build -t test-app-a --target test-app-a .
docker build -t test-app-b --target test-app-b .
-docker network create --driver overlay bouncer-test
$(MAKE) start_bouncer
$(MAKE) start_test_a
$(MAKE) start_test_b
docker service logs -f bouncer
start_test_a:
docker service create \
--network bouncer-test \
--name test-app-a \
--env BOUNCER_DOMAIN=test-a.local \
--env BOUNCER_ALLOW_NON_SSL=yes \
--publish 8081:80 \
test-app-a
start_test_b:
docker service create \
--network bouncer-test \
--name test-app-b \
--env BOUNCER_DOMAIN=test-b.local \
--env BOUNCER_ALLOW_NON_SSL=yes \
--publish 8082:80 \
test-app-b
start_bouncer:
docker service create \
--network bouncer-test \
--name bouncer \
--publish 8080:80 \
--mount type=bind,destination=/var/run/docker.sock,source=/var/run/docker.sock \
bouncer
clean:
-docker service rm bouncer test-app-a test-app-b
#-docker network rm bouncer-test
#-docker image rm test-app-a test-app-b bouncer