diff --git a/Dockerfile b/Dockerfile index f00e3b4..13b3316 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,10 +24,11 @@ ARG AWSTATS_VERSION=7.9-r0 RUN apk add --no-cache awstats=${AWSTATS_VERSION} tzdata=${TZDATA_VERSION} \ && touch /etc/awstats/awstats.conf \ - && chmod g+w /etc/awstats/awstats.conf + && chmod g+w /etc/awstats/awstats.conf \ + && sed 's/^Listen 80/Listen $HTTPD_PORT/' /usr/local/apache2/conf/httpd.conf > /usr/local/apache2/conf/httpd_env.conf COPY awstats_env.conf /etc/awstats/ -COPY awstats_httpd.conf /usr/local/apache2/conf/ +COPY awstats_httpd_env.conf /usr/local/apache2/conf/ COPY entrypoint.sh /usr/local/bin/ ENV AWSTATS_CONF_LOGFILE="/var/local/log/access.log" @@ -36,6 +37,7 @@ ENV AWSTATS_CONF_SITEDOMAIN="my_website" ENV AWSTATS_CONF_HOSTALIASES="localhost 127.0.0.1 REGEX[^.*$]" ENV AWSTATS_CONF_INCLUDE="." ENV AWSTATS_CONF_ALLOWFULLYEARVIEW=2 +ENV HTTPD_PORT="80" ENTRYPOINT ["entrypoint.sh"] CMD ["httpd-foreground"] diff --git a/awstats_httpd.conf b/awstats_httpd_env.conf similarity index 93% rename from awstats_httpd.conf rename to awstats_httpd_env.conf index 0a302df..62d60a4 100644 --- a/awstats_httpd.conf +++ b/awstats_httpd_env.conf @@ -1,4 +1,4 @@ - + LoadModule cgi_module modules/mod_cgi.so LoadModule perl_module /usr/lib/apache2/mod_perl.so diff --git a/entrypoint.sh b/entrypoint.sh index e9ce473..9482e9c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,5 +7,7 @@ if [ -x /usr/local/bin/autorun.sh ]; then fi envsubst /etc/awstats/awstats.conf +envsubst /usr/local/apache2/conf/awstats_httpd.conf +envsubst /usr/local/apache2/conf/httpd.conf exec "$@"