Skip to content

Commit 3893fef

Browse files
committed
Streamline
1 parent cb5126a commit 3893fef

File tree

3 files changed

+124
-1
lines changed

3 files changed

+124
-1
lines changed

.github/workflows/docker-compose.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
3+
# -------------------------------------------------------------------------------------------------
4+
# Job Name
5+
# -------------------------------------------------------------------------------------------------
6+
name: docker-compose
7+
8+
9+
# -------------------------------------------------------------------------------------------------
10+
# When to run
11+
# -------------------------------------------------------------------------------------------------
12+
on:
13+
pull_request:
14+
paths:
15+
- '.github/workflows/docker-compose.yml'
16+
- 'Dockerfiles/**'
17+
- 'examples/**/docker-compose.yml'
18+
- 'examples/**/integration-test.sh'
19+
- 'examples/integration-test.sh'
20+
21+
22+
jobs:
23+
docker-compose:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
- name: 'docker-compose: main-vhost Static Files'
30+
run: |
31+
cd ./examples/default-vhost__static-files/
32+
./integration-test.sh
33+
34+
- name: 'docker-compose: main-vhost PHP-FPM'
35+
run: |
36+
cd ./examples/default-vhost__php-fpm/
37+
./integration-test.sh
38+
39+
- name: 'docker-compose: main-vhost PHP-FPM (SSL)'
40+
run: |
41+
cd ./examples/default-vhost__php-fpm__ssl/
42+
./integration-test.sh
43+
44+
- name: 'docker-compose: main-vhost Reverse Proxy (NodeJS)'
45+
run: |
46+
cd ./examples/default-vhost__reverse-proxy__node/
47+
./integration-test.sh
48+
49+
- name: 'docker-compose: mass-vhost PHP-FPM (SSL)'
50+
run: |
51+
cd ./examples/mass-vhost__php-fpm__ssl/
52+
./integration-test.sh
53+
54+
- name: 'docker-compose: mass-vhost Reverse Proxy (SSL)'
55+
run: |
56+
cd ./examples/mass-vhost__reverse-proxy__ssl/
57+
./integration-test.sh

Dockerfiles/data/nginx/nginx.conf

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ http {
3434

3535
access_log /var/log/httpd/access.log main;
3636

37+
# [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
38+
# https://stackoverflow.com/questions/26357487/
39+
server_names_hash_bucket_size 64;
40+
3741

3842
# -------------------------------------------------------------------------------
3943
# NGINX HEADER
@@ -63,7 +67,7 @@ http {
6367

6468
# The maximum allowed size for a client request. If the maximum size is exceeded,
6569
# then Nginx will spit out a 413 error or Request Entity Too Large.
66-
# Setting size to 0 disables checking of client request body size.
70+
# Setting size to 0 disables checking of client request body size.
6771
client_max_body_size 0;
6872

6973

Makefile

+62
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,65 @@ manifest-push: docker-manifest-push
9191
.PHONY: test
9292
test:
9393
./tests/start-ci.sh $(IMAGE) $(DOCKER_TAG) $(ARCH)
94+
95+
96+
# -------------------------------------------------------------------------------------------------
97+
# Internal Repository Targets
98+
# -------------------------------------------------------------------------------------------------
99+
.PHONY: _repo_fix
100+
_repo_fix: __repo_fix_examples
101+
_repo_fix: __repo_fix_doc
102+
_repo_fix: __repo_fix_readme
103+
104+
###
105+
### In case I've copied the examples/ from any repo, ensure to replace images with current
106+
###
107+
.PHONY: __repo_fix_examples
108+
__repo_fix_examples:
109+
find examples/ -type f -print0 | xargs -0 -n1 sh -c \
110+
'if grep "nginx-stable" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-stable|$(IMAGE)|g" "$${1}";fi' --
111+
find examples/ -type f -print0 | xargs -0 -n1 sh -c \
112+
'if grep "nginx-mainline" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-mainline|$(IMAGE)|g" "$${1}";fi' --
113+
find examples/ -type f -print0 | xargs -0 -n1 sh -c \
114+
'if grep "apache-2.2" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.2|$(IMAGE)|g" "$${1}";fi' --
115+
find examples/ -type f -print0 | xargs -0 -n1 sh -c \
116+
'if grep "apache-2.4" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.4|$(IMAGE)|g" "$${1}";fi' --
117+
118+
###
119+
### In case I've copied the doc/ from any repo, ensure to replace images with current
120+
###
121+
.PHONY: __repo_fix_doc
122+
__repo_fix_doc:
123+
find doc/ -name '*.md' -type f -print0 | xargs -0 -n1 sh -c \
124+
'if grep "nginx-stable" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-stable|$(IMAGE)|g" "$${1}";fi' --
125+
find doc/ -name '*.md' -type f -print0 | xargs -0 -n1 sh -c \
126+
'if grep "nginx-mainline" "$${1}">/dev/null; then sed -i"" "s|devilbox/nginx-mainline|$(IMAGE)|g" "$${1}";fi' --
127+
find doc/ -name '*.md' -type f -print0 | xargs -0 -n1 sh -c \
128+
'if grep "apache-2.2" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.2|$(IMAGE)|g" "$${1}";fi' --
129+
find doc/ -name '*.md' -type f -print0 | xargs -0 -n1 sh -c \
130+
'if grep "apache-2.4" "$${1}">/dev/null; then sed -i"" "s|devilbox/apache-2.4|$(IMAGE)|g" "$${1}";fi' --
131+
132+
###
133+
### In case I've copied the doc/ from any repo, ensure to replace images with current
134+
###
135+
.PHONY: __repo_fix_readme
136+
__repo_fix_readme:
137+
sed -i'' "s/^# Nginx stable$$/# $(NAME) $(VERSION)/g" README.md
138+
sed -i'' "s/^# Nginx mainline$$/# $(NAME) $(VERSION)/g" README.md
139+
sed -i'' "s/^# Apache 2.2$$/# $(NAME) $(VERSION)/g" README.md
140+
sed -i'' "s/^# Apache 2.4$$/# $(NAME) $(VERSION)/g" README.md
141+
@#
142+
sed -i'' "s|docker--nginx--stable|$$( echo "docker/$(IMAGE)" | awk -F'/' '{print $$1"-"$$3}' | awk -F'-' '{print $$1"--"$$2"--"$$3}' )|g" README.md
143+
sed -i'' "s|docker--nginx--mainline|$$( echo "docker/$(IMAGE)" | awk -F'/' '{print $$1"-"$$3}' | awk -F'-' '{print $$1"--"$$2"--"$$3}' )|g" README.md
144+
sed -i'' "s|docker--apache--2.2|$$( echo "docker/$(IMAGE)" | awk -F'/' '{print $$1"-"$$3}' | awk -F'-' '{print $$1"--"$$2"--"$$3}' )|g" README.md
145+
sed -i'' "s|docker--apache--2.4|$$( echo "docker/$(IMAGE)" | awk -F'/' '{print $$1"-"$$3}' | awk -F'-' '{print $$1"--"$$2"--"$$3}' )|g" README.md
146+
@#
147+
sed -i'' "s|docker-nginx-stable|$$( echo "docker-/$(IMAGE)" | awk -F'/' '{print $$1$$3}')|g" README.md
148+
sed -i'' "s|docker-nginx-mainline|$$( echo "docker-/$(IMAGE)" | awk -F'/' '{print $$1$$3}')|g" README.md
149+
sed -i'' "s|docker-apache-2.2|$$( echo "docker-/$(IMAGE)" | awk -F'/' '{print $$1$$3}')|g" README.md
150+
sed -i'' "s|docker-apache-2.4|$$( echo "docker-/$(IMAGE)" | awk -F'/' '{print $$1$$3}')|g" README.md
151+
@#
152+
sed -i'' 's|devilbox/nginx-stable|$(IMAGE)|g' README.md
153+
sed -i'' 's|devilbox/nginx-mainline|$(IMAGE)|g' README.md
154+
sed -i'' 's|devilbox/apache-2.2|$(IMAGE)|g' README.md
155+
sed -i'' 's|devilbox/apache-2.4|$(IMAGE)|g' README.md

0 commit comments

Comments
 (0)