-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from devilbox/release-0.15
WIP: Add HTTPS support
- Loading branch information
Showing
24 changed files
with
1,436 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,29 @@ MAINTAINER "cytopia" <[email protected]> | |
|
||
|
||
### | ||
### Labels | ||
### Build arguments | ||
### | ||
LABEL \ | ||
name="cytopia's Apache 2.4 Image" \ | ||
image="apache-2.4" \ | ||
vendor="devilbox" \ | ||
license="MIT" \ | ||
build-date="2017-10-01" | ||
ARG VHOST_GEN_GIT_REF=0.5 | ||
ARG CERT_GEN_GIT_REF=0.2 | ||
|
||
ENV BUILD_DEPS \ | ||
git \ | ||
make \ | ||
wget | ||
|
||
ENV RUN_DEPS \ | ||
ca-certificates \ | ||
python-yaml \ | ||
supervisor | ||
|
||
|
||
### | ||
### Runtime arguments | ||
### | ||
ENV MY_USER=daemon | ||
ENV MY_GROUP=daemon | ||
ENV HTTPD_START="httpd-foreground" | ||
ENV HTTPD_RELOAD="/usr/local/apache2/bin/httpd -k restart" | ||
|
||
|
||
### | ||
|
@@ -22,36 +37,31 @@ RUN set -x \ | |
&& apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install --no-install-recommends --no-install-suggests -y \ | ||
make \ | ||
python-yaml \ | ||
supervisor \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get purge -y --auto-remove | ||
|
||
# vhost-gen | ||
RUN set -x \ | ||
&& wget --no-check-certificate -O vhost_gen.tar.gz https://github.com/devilbox/vhost-gen/archive/master.tar.gz \ | ||
&& tar xfvz vhost_gen.tar.gz \ | ||
&& cd vhost-gen-master \ | ||
${BUILD_DEPS} \ | ||
${RUN_DEPS} \ | ||
\ | ||
# Install vhost-gen | ||
&& git clone https://github.com/devilbox/vhost-gen \ | ||
&& cd vhost-gen \ | ||
&& git checkout "${VHOST_GEN_GIT_REF}" \ | ||
&& make install \ | ||
&& cd .. \ | ||
&& rm -rf vhost*gen* | ||
|
||
# watcherd | ||
RUN set -x \ | ||
&& rm -rf vhost*gen* \ | ||
\ | ||
# Install cert-gen | ||
&& wget --no-check-certificate -O /usr/bin/ca-gen https://raw.githubusercontent.com/devilbox/cert-gen/${CERT_GEN_GIT_REF}/bin/ca-gen \ | ||
&& wget --no-check-certificate -O /usr/bin/cert-gen https://raw.githubusercontent.com/devilbox/cert-gen/${CERT_GEN_GIT_REF}/bin/cert-gen \ | ||
&& chmod +x /usr/bin/ca-gen \ | ||
&& chmod +x /usr/bin/cert-gen \ | ||
\ | ||
# Install watcherd | ||
&& wget --no-check-certificate -O /usr/bin/watcherd https://raw.githubusercontent.com/devilbox/watcherd/master/watcherd \ | ||
&& chmod +x /usr/bin/watcherd | ||
|
||
# cleanup | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get remove -y \ | ||
make \ | ||
wget \ | ||
&& apt-get autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get purge -y --auto-remove | ||
&& chmod +x /usr/bin/watcherd \ | ||
\ | ||
# Clean-up | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ | ||
${BUILD_DEPS} \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Add custom config directive to httpd server | ||
RUN set -x \ | ||
|
@@ -64,6 +74,18 @@ RUN set -x \ | |
echo "IncludeOptional /etc/httpd-custom.d/*.conf"; \ | ||
echo "IncludeOptional /etc/httpd/conf.d/*.conf"; \ | ||
echo "IncludeOptional /etc/httpd/vhost.d/*.conf"; \ | ||
\ | ||
echo "LoadModule ssl_module modules/mod_ssl.so"; \ | ||
echo "LoadModule socache_shmcb_module modules/mod_socache_shmcb.so" ;\ | ||
echo "Listen 443"; \ | ||
echo "SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES"; \ | ||
echo "SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES"; \ | ||
echo "SSLHonorCipherOrder on"; \ | ||
echo "SSLProtocol all -SSLv3"; \ | ||
echo "SSLProxyProtocol all -SSLv3"; \ | ||
echo "SSLPassPhraseDialog builtin"; \ | ||
echo "SSLSessionCache \"shmcb:/usr/local/apache2/logs/ssl_scache(512000)\""; \ | ||
echo "SSLSessionCacheTimeout 300"; \ | ||
) >> /usr/local/apache2/conf/httpd.conf | ||
|
||
# create directories | ||
|
@@ -74,28 +96,31 @@ RUN set -x \ | |
&& mkdir -p /var/www/default/htdocs \ | ||
&& mkdir -p /shared/httpd \ | ||
&& chmod 0775 /shared/httpd \ | ||
&& chown daemon:daemon /shared/httpd | ||
&& chown ${MY_USER}:${MY_GROUP} /shared/httpd | ||
|
||
|
||
### | ||
### Copy files | ||
### | ||
COPY ./data/vhost-gen/conf.yml /etc/vhost-gen/conf.yml | ||
COPY ./data/vhost-gen/main.yml /etc/vhost-gen/main.yml | ||
COPY ./data/supervisord.conf /etc/supervisord.conf | ||
COPY ./data/vhost-gen/mass.yml /etc/vhost-gen/mass.yml | ||
COPY ./data/create-vhost.sh /usr/local/bin/create-vhost.sh | ||
COPY ./data/docker-entrypoint.d /docker-entrypoint.d | ||
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
|
||
### | ||
### Ports | ||
### | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
|
||
### | ||
### Volumes | ||
### | ||
VOLUME /shared/httpd | ||
VOLUME /ca | ||
|
||
|
||
### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.