traefik_typo3/Dockerfile

71 lines
2.1 KiB
Docker
Raw Normal View History

2023-11-26 12:24:49 +01:00
# Dockerfile
# Docker image for TYPO3 CMS
FROM php:8.2-apache
LABEL maintainer="Raphael Martin <raphy.martin@protonmail.ch>"
ENV APACHE_RUN_USER a2g-www
ENV TYPO3_VERSION 12.4.8
ENV TYPO3_SHA256CHECKSUM 8293b3441ec133fc8f9174fab5b88f450044ded0e188a0f12de37ad60a8bf8b3
# change apache user
RUN adduser --uid 1000 --gecos 'Apache User' --disabled-password $APACHE_RUN_USER \
&& chown -R "$APACHE_RUN_USER:$APACHE_RUN_USER" /var/lock/apache2 /var/run/apache2
# update system
RUN apt-get update -y && apt-get upgrade -y
# Install TYPO3
RUN apt-get install -y --no-install-recommends \
wget \
# Configure PHP
libxml2-dev libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libpq-dev \
libzip-dev \
zlib1g-dev \
sendmail \
graphicsmagick && \
docker-php-ext-configure gd --with-libdir=/usr/include/ --with-jpeg --with-freetype && \
docker-php-ext-install -j$(nproc) mysqli soap gd zip opcache intl pgsql pdo_pgsql
# Clean
RUN apt-get -y purge \
libxml2-dev libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libzip-dev \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/src/*
RUN mkdir /usr/local/surf && \
curl -L https://github.com/TYPO3/Surf/releases/download/3.4.6/surf.phar -o /usr/local/surf/surf.phar && \
chmod +x /usr/local/surf/surf.phar && \
ln -s /usr/local/surf/surf.phar /usr/local/bin/surf
# Configure Apache as needed
RUN a2enmod rewrite
RUN cd /tmp && \
wget -O download.tar.gz https://get.typo3.org/${TYPO3_VERSION} && \
echo "${TYPO3_SHA256CHECKSUM} /tmp/download.tar.gz" > /tmp/download.tar.gz.sum
RUN sha256sum -c "/tmp/download.tar.gz.sum"
RUN tar -xzf /tmp/download.tar.gz -C /var/www/ && \
rm /tmp/download*
RUN cd /var/www/html && \
ln -s ../typo3_src-* typo3_src && \
ln -s typo3_src/index.php && \
ln -s typo3_src/typo3 && \
touch FIRST_INSTALL
RUN chown -R $APACHE_RUN_USER:$APACHE_RUN_USER /var/www/html && \
chown -R $APACHE_RUN_USER:$APACHE_RUN_USER /var/www/typo3_src-*