Skip to content

Commit 6d3ffff

Browse files
committed
merge some steps to get fewer layers and add log rotation
1 parent 37586b7 commit 6d3ffff

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

Dockerfile.release

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM debian:bookworm-slim
44
LABEL maintainer="michiel@phplist.com"
55

66
RUN apt-get update && apt-get upgrade -y && apt-get install -y apt-utils \
7-
apache2 php-mysql \
7+
apache2 php-mysql logrotate \
88
libapache2-mod-php php-curl php-gd \
99
cron php-imap php-xml php-zip php-mbstring
1010

@@ -13,36 +13,30 @@ RUN useradd -d /var/www/phpList3 phplist
1313
ARG VERSION=unknown
1414
RUN echo VERSION=${VERSION}
1515

16-
RUN rm -rf /var/www/phpList3 && mkdir -p /var/www/phpList3
17-
RUN rm -rf /etc/phplist && mkdir /etc/phplist
16+
RUN rm -rf /var/www/phpList3 && mkdir -p /var/www/phpList3 && rm -rf /etc/phplist && mkdir /etc/phplist
1817

1918
COPY docker/docker-apache-phplist.conf /etc/apache2/sites-available
2019
COPY docker/security.conf /etc/apache2/conf-available
2120
COPY docker/docker-entrypoint.sh /usr/local/bin/
2221
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh
23-
RUN a2ensite docker-apache-phplist
24-
RUN a2enmod rewrite
25-
RUN a2enmod headers
26-
RUN a2disconf other-vhosts-access-log
27-
RUN sed -i s/LogLevel.*/LogLevel\ warn/ /etc/apache2/apache2.conf
22+
RUN a2ensite docker-apache-phplist && a2enmod rewrite && a2enmod headers && a2disconf other-vhosts-access-log && sed -i s/LogLevel.*/LogLevel\ warn/ /etc/apache2/apache2.conf
2823

2924
COPY docker/phplist-crontab /etc/cron.d/
25+
COPY docker/phplist-logrotate /etc/logrotate.d/phplist
3026
COPY docker/docker-phplist-config-live.php /etc/phplist/config.php
3127

3228
COPY phplist-${VERSION}.tgz ./
3329

34-
RUN tar zxf phplist-$VERSION.tgz
35-
RUN mv phplist-$VERSION/* /var/www/phpList3/
36-
RUN rm -rf /phplist-$VERSION*
37-
30+
RUN tar zxf phplist-$VERSION.tgz && mv phplist-$VERSION/* /var/www/phpList3/ && rm -rf /phplist-$VERSION*
3831
RUN mkdir -p /var/tmp/phplistupdate && chown www-data /var/tmp/phplistupdate
3932

4033
RUN rm -f /etc/apache2/sites-enabled/000-default.conf && \
4134
cd /var/www/ && find . -type d -name .git -print0 | xargs -0 rm -rf && \
4235
find . -type d -print0 | xargs -0 chmod 755 && \
4336
find . -type f -print0 | xargs -0 chmod 644
4437

45-
RUN chown -R www-data: /var/www/phpList3
38+
RUN mkdir -p /var/www/phpList3/public_html/images && chown -R www-data: /var/www/phpList3
39+
RUN apt -y remove exim4-base && apt -y auto-remove
4640

4741
EXPOSE 80
4842

0 commit comments

Comments
 (0)