Skip to content

Commit 146ee40

Browse files
authored
Merge pull request #47 from devilbox/release-0.44
Add Alpine Docker flavour
2 parents 6d7856b + 3b3fc0c commit 146ee40

25 files changed

+193
-7
lines changed

.github/workflows/action_branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# (2/2) Build
2323
docker:
2424
needs: [params]
25-
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
25+
uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master
2626
with:
2727
enabled: true
2828
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}

.github/workflows/action_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# (2/2) Build
2525
docker:
2626
needs: [params]
27-
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
27+
uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master
2828
with:
2929
enabled: true
3030
can_deploy: false

.github/workflows/action_schedule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# (2/2) Build
2525
docker:
2626
needs: [params]
27-
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
27+
uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master
2828
with:
2929
enabled: true
3030
can_deploy: true

.github/workflows/params.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
{
1616
"NAME": "Apache",
1717
"VERSION": ["2.4"],
18+
"FLAVOUR": ["latest", "debian", "alpine"],
1819
"ARCH": ["linux/amd64", "linux/386", "linux/arm64", "linux/arm/v7", "linux/arm/v6"]
1920
}
2021
]

Dockerfiles/Dockerfile.alpine

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
FROM httpd:2.4-alpine
2+
MAINTAINER "cytopia" <cytopia@everythingcli.org>
3+
4+
LABEL \
5+
name="cytopia's apache 2.4 image" \
6+
image="devilbox/apache-2.4" \
7+
vendor="devilbox" \
8+
license="MIT"
9+
10+
11+
###
12+
### Build arguments
13+
###
14+
ARG VHOST_GEN_GIT_REF=1.0.3
15+
ARG WATCHERD_GIT_REF=v1.0.2
16+
ARG CERT_GEN_GIT_REF=0.7
17+
18+
ENV BUILD_DEPS \
19+
make \
20+
wget
21+
22+
ENV RUN_DEPS \
23+
ca-certificates \
24+
bash \
25+
openssl \
26+
py3-yaml \
27+
shadow \
28+
supervisor
29+
30+
31+
###
32+
### Runtime arguments
33+
###
34+
ENV MY_USER=www-data
35+
ENV MY_GROUP=www-data
36+
ENV HTTPD_START="httpd-foreground"
37+
ENV HTTPD_RELOAD="/usr/local/apache2/bin/httpd -k stop"
38+
39+
40+
###
41+
### Install required packages
42+
###
43+
RUN set -eux \
44+
&& apk add --no-cache \
45+
${BUILD_DEPS} \
46+
${RUN_DEPS} \
47+
\
48+
# Install vhost-gen
49+
&& wget --no-check-certificate -O vhost-gen.tar.gz "https://github.com/devilbox/vhost-gen/archive/refs/tags/${VHOST_GEN_GIT_REF}.tar.gz" \
50+
&& tar xvfz vhost-gen.tar.gz \
51+
&& cd "vhost-gen-${VHOST_GEN_GIT_REF}" \
52+
&& make install \
53+
&& cd .. \
54+
&& rm -rf vhost*gen* \
55+
\
56+
# Install cert-gen
57+
&& wget --no-check-certificate -O /usr/bin/ca-gen https://raw.githubusercontent.com/devilbox/cert-gen/${CERT_GEN_GIT_REF}/bin/ca-gen \
58+
&& wget --no-check-certificate -O /usr/bin/cert-gen https://raw.githubusercontent.com/devilbox/cert-gen/${CERT_GEN_GIT_REF}/bin/cert-gen \
59+
&& chmod +x /usr/bin/ca-gen \
60+
&& chmod +x /usr/bin/cert-gen \
61+
\
62+
# Install watcherd
63+
&& wget --no-check-certificate -O /usr/bin/watcherd https://raw.githubusercontent.com/devilbox/watcherd/${WATCHERD_GIT_REF}/watcherd \
64+
&& chmod +x /usr/bin/watcherd \
65+
\
66+
# Clean-up
67+
&& apk del \
68+
${BUILD_DEPS}
69+
70+
71+
###
72+
### Configure Apache
73+
###
74+
RUN set -eux \
75+
&& APACHE_VERSION="$( httpd -V | grep -Eo 'Apache/[.0-9]+' | awk -F'/' '{print $2}' )" \
76+
&& ( \
77+
echo "ServerName localhost"; \
78+
\
79+
echo "LoadModule http2_module modules/mod_http2.so"; \
80+
echo "LoadModule proxy_module modules/mod_proxy.so"; \
81+
echo "LoadModule proxy_http_module modules/mod_proxy_http.so"; \
82+
echo "LoadModule proxy_http2_module modules/mod_proxy_http2.so"; \
83+
echo "LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so"; \
84+
echo "LoadModule rewrite_module modules/mod_rewrite.so"; \
85+
\
86+
echo "Include conf/extra/httpd-default.conf"; \
87+
echo "IncludeOptional /etc/httpd-custom.d/*.conf"; \
88+
echo "IncludeOptional /etc/httpd/conf.d/*.conf"; \
89+
echo "IncludeOptional /etc/httpd/vhost.d/*.conf"; \
90+
\
91+
echo "LoadModule ssl_module modules/mod_ssl.so"; \
92+
echo "LoadModule socache_shmcb_module modules/mod_socache_shmcb.so" ;\
93+
echo "Listen 443"; \
94+
echo "SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES"; \
95+
echo "SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES"; \
96+
echo "SSLHonorCipherOrder on"; \
97+
echo "SSLProtocol all -SSLv3"; \
98+
echo "SSLProxyProtocol all -SSLv3"; \
99+
echo "SSLPassPhraseDialog builtin"; \
100+
echo "SSLSessionCache \"shmcb:/usr/local/apache2/logs/ssl_scache(512000)\""; \
101+
echo "SSLSessionCacheTimeout 300"; \
102+
\
103+
echo "<If \"%{THE_REQUEST} =~ m#^.*HTTP/1\.0\$#\">"; \
104+
echo " Header always set Via \"1.0 %{HOSTNAME}e (apache/${APACHE_VERSION})\""; \
105+
echo "</If>"; \
106+
echo "<If \"%{THE_REQUEST} =~ m#^.*HTTP/1\.1\$#\">"; \
107+
echo " Header always set Via \"1.1 %{HOSTNAME}e (apache/${APACHE_VERSION})\""; \
108+
echo "</If>"; \
109+
echo "<If \"%{THE_REQUEST} =~ m#^.*HTTP/2\.0\$#\">"; \
110+
echo " Header always set Via \"2.0 %{HOSTNAME}e (apache/${APACHE_VERSION})\""; \
111+
echo "</If>"; \
112+
\
113+
echo "HTTPProtocolOptions unsafe"; \
114+
\
115+
# https://github.com/cytopia/devilbox/issues/862
116+
echo "Mutex sem"; \
117+
\
118+
) >> /usr/local/apache2/conf/httpd.conf
119+
120+
121+
###
122+
### Create directories
123+
###
124+
RUN set -eux \
125+
&& mkdir -p /etc/httpd-custom.d \
126+
&& mkdir -p /etc/httpd/conf.d \
127+
&& mkdir -p /etc/httpd/vhost.d \
128+
&& mkdir -p /var/www/default/htdocs \
129+
&& mkdir -p /shared/httpd \
130+
&& chmod 0775 /shared/httpd \
131+
&& chown ${MY_USER}:${MY_GROUP} /shared/httpd
132+
133+
134+
###
135+
### Symlink Python3 to Python
136+
###
137+
RUN set -eux \
138+
&& ln -sf /usr/bin/python3 /usr/bin/python
139+
140+
141+
###
142+
### Copy files
143+
###
144+
COPY ./data/vhost-gen/main.yml /etc/vhost-gen/main.yml
145+
COPY ./data/vhost-gen/mass.yml /etc/vhost-gen/mass.yml
146+
COPY ./data/create-vhost.sh /usr/local/bin/create-vhost.sh
147+
COPY ./data/docker-entrypoint.d /docker-entrypoint.d
148+
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
149+
150+
151+
###
152+
### Ports
153+
###
154+
EXPOSE 80
155+
EXPOSE 443
156+
157+
158+
###
159+
### Volumes
160+
###
161+
VOLUME /shared/httpd
162+
VOLUME /ca
163+
164+
165+
###
166+
### Signals
167+
###
168+
STOPSIGNAL SIGTERM
169+
170+
171+
###
172+
### Entrypoint
173+
###
174+
ENTRYPOINT ["/docker-entrypoint.sh"]

Dockerfiles/Dockerfile.latest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile.debian
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)