Skip to content

Commit 4e22a72

Browse files
committed
Revert "Several changes"
This reverts commit 4f7443d.
1 parent b7781a2 commit 4e22a72

2 files changed

Lines changed: 16 additions & 39 deletions

File tree

Dockerfile

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ RUN apk --no-cache --update \
2828
php8-pdo_sqlite \
2929
php8-phar \
3030
php8-session \
31-
tzdata \
3231
php8-xml \
3332
php8-tokenizer \
3433
php8-zip \
@@ -37,23 +36,12 @@ RUN apk --no-cache --update \
3736
COPY littlelink-custom /htdocs
3837
RUN chown -R apache:apache /htdocs
3938
RUN find /htdocs -type d -print0 | xargs -0 chmod 0755
40-
RUN find /htdocs -type f -print0 | xargs -0 chmod 0644
39+
RUN find /htdocs -type f -print0 | xargs -0 chmod 0644
4140

4241
EXPOSE 80 443
4342

44-
COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/
43+
ADD docker-entrypoint.sh /
4544

46-
HEALTHCHECK CMD curl -f http://localhost -A "HealthCheck" || exit 1
45+
HEALTHCHECK CMD wget -q --no-cache --spider localhost
4746

48-
# Forward Apache access and error logs to Docker's log collector.
49-
# Optional last line adds extra verbosity with for example:
50-
# [ssl:info] [pid 33] [client 10.0.5.8:45542] AH01964: Connection to child 2 established (server your.domain:443)
51-
RUN ln -sf /dev/stdout /var/www/logs/access.log \
52-
&& ln -sf /dev/stderr /var/www/logs/error.log \
53-
&& ln -sf /dev/stderr /var/www/logs/ssl-access.log
54-
# && ln -sf /dev/stderr /var/www/logs/ssl-error.log
55-
56-
# Set console entry path
57-
WORKDIR /htdocs/littlelink
58-
59-
CMD ["docker-entrypoint.sh"]
47+
ENTRYPOINT ["/docker-entrypoint.sh"]

docker-entrypoint.sh

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Exit on non defined variables and on non zero exit codes
44
set -eu
55

6-
# Get/Set Variables
76
SERVER_ADMIN="${SERVER_ADMIN:-you@example.com}"
87
HTTP_SERVER_NAME="${HTTP_SERVER_NAME:-localhost}"
98
HTTPS_SERVER_NAME="${HTTPS_SERVER_NAME:-localhost}"
@@ -12,42 +11,33 @@ TZ="${TZ:-UTC}"
1211
PHP_MEMORY_LIMIT="${PHP_MEMORY_LIMIT:-256M}"
1312
UPLOAD_MAX_FILESIZE="${UPLOAD_MAX_FILESIZE:-8M}"
1413

15-
echo 'Updating Configuration: Apache Base (/etc/apache2/httpd.conf)'
14+
echo 'Updating configurations'
1615

1716
# Change Server Admin, Name, Document Root
1817
sed -i "s/ServerAdmin\ you@example.com/ServerAdmin\ ${SERVER_ADMIN}/" /etc/apache2/httpd.conf
19-
sed -i "s/#ServerName\ www.example.com:80/ServerName\ ${HTTP_SERVER_NAME}/" /etc/apache2/httpd.conf
18+
sed -i "s/#ServerName\ localhost:80/ServerName\ ${HTTP_SERVER_NAME}/" /etc/apache2/httpd.conf
2019
sed -i 's#^DocumentRoot ".*#DocumentRoot "/htdocs"#g' /etc/apache2/httpd.conf
2120
sed -i 's#Directory "/var/www/localhost/htdocs"#Directory "/htdocs"#g' /etc/apache2/httpd.conf
2221
sed -i 's#AllowOverride None#AllowOverride All#' /etc/apache2/httpd.conf
2322

2423
# Change TransferLog after ErrorLog
25-
sed -i 's#^ErrorLog .*#ErrorLog "logs/error.log"#g' /etc/apache2/httpd.conf
26-
sed -i 's#LogFormat .* %t#LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u#g' /etc/apache2/httpd.conf
27-
sed -i 's#CustomLog .* combined#BrowserMatchNoCase ^healthcheck nolog\n\n CustomLog "logs/access.log" combinedio env=!nolog\n#g' /etc/apache2/httpd.conf
24+
sed -i 's#^ErrorLog .*#ErrorLog "/dev/stderr"\nTransferLog "/dev/stdout"#g' /etc/apache2/httpd.conf
25+
sed -i 's#CustomLog .* combined#CustomLog "/dev/stdout" combined#g' /etc/apache2/httpd.conf
26+
27+
# SSL DocumentRoot and Log locations
28+
sed -i 's#^ErrorLog .*#ErrorLog "/dev/stderr"#g' /etc/apache2/conf.d/ssl.conf
29+
sed -i 's#^TransferLog .*#TransferLog "/dev/stdout"#g' /etc/apache2/conf.d/ssl.conf
30+
sed -i 's#^DocumentRoot ".*#DocumentRoot "/htdocs"#g' /etc/apache2/conf.d/ssl.conf
31+
sed -i "s/ServerAdmin\ you@example.com/ServerAdmin\ ${SERVER_ADMIN}/" /etc/apache2/conf.d/ssl.conf
32+
sed -i "s/ServerName\ localhost:443/ServerName\ ${HTTPS_SERVER_NAME}/" /etc/apache2/conf.d/ssl.conf
2833

2934
# Re-define LogLevel
3035
sed -i "s#^LogLevel .*#LogLevel ${LOG_LEVEL}#g" /etc/apache2/httpd.conf
3136

3237
# Enable commonly used apache modules
38+
sed -i 's/#LoadModule\ rewrite_module/LoadModule\ rewrite_module/' /etc/apache2/httpd.conf
3339
sed -i 's/#LoadModule\ deflate_module/LoadModule\ deflate_module/' /etc/apache2/httpd.conf
3440
sed -i 's/#LoadModule\ expires_module/LoadModule\ expires_module/' /etc/apache2/httpd.conf
35-
sed -i 's/#LoadModule\ logio_module/LoadModule\ logio_module/' /etc/apache2/httpd.conf
36-
sed -i 's/#LoadModule\ rewrite_module/LoadModule\ rewrite_module/' /etc/apache2/httpd.conf
37-
38-
echo 'Updating Configuration: Apache SSL (/etc/apache2/conf.d/ssl.conf)'
39-
40-
# SSL DocumentRoot and Log locations
41-
sed -i 's#^ErrorLog .*#ErrorLog "logs/ssl-error.log"#g' /etc/apache2/conf.d/ssl.conf
42-
sed -i "s/^TransferLog .*/#TransferLog \"logs\/ssl-transfer.log\"\nLogLevel ${LOG_LEVEL}/g" /etc/apache2/conf.d/ssl.conf
43-
sed -i 's#^DocumentRoot ".*#DocumentRoot "/htdocs"#g' /etc/apache2/conf.d/ssl.conf
44-
sed -i "s/ServerAdmin\ you@example.com/ServerAdmin\ ${SERVER_ADMIN}/" /etc/apache2/conf.d/ssl.conf
45-
sed -i "s/ServerName\ www.example.com:443/ServerName\ ${HTTPS_SERVER_NAME}/" /etc/apache2/conf.d/ssl.conf
46-
47-
sed -i 's#CustomLog .*#LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [ssl.conf] %h %l %u \\"%r\\" %>s %b \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined\n\nCustomLog "logs/ssl-access.log" combined#g' /etc/apache2/conf.d/ssl.conf
48-
sed -i '/.*%{SSL_PROTOCOL}x.*/d' /etc/apache2/conf.d/ssl.conf
49-
50-
echo 'Updating Configuration: PHP (/etc/php8/php.ini)'
5141

5242
# Modify php memory limit and timezone
5343
sed -i "s/memory_limit = .*/memory_limit = ${PHP_MEMORY_LIMIT}/" /etc/php8/php.ini
@@ -56,7 +46,6 @@ sed -i "s#^;date.timezone =\$#date.timezone = \"${TZ}\"#" /etc/php8/php.ini
5646

5747
echo "is_llc_docker = true" >> /etc/php8/php.ini
5848

59-
echo 'Updating Configuration: Complete'
6049
echo 'Running Apache'
6150

6251
httpd -D FOREGROUND

0 commit comments

Comments
 (0)