This commit is contained in:
Raphael Martin 2023-11-29 14:22:58 +01:00
parent fd7732dec2
commit 29780d29d9
3 changed files with 31 additions and 10 deletions

View File

@ -97,15 +97,34 @@ RUN apt-get -y purge \
# Configure Apache # Configure Apache
RUN set -eux; \ RUN set -eux; \
docker-php-ext-enable opcache; \ a2enmod alias authz_core deflate filter rewrite expires setenvif remoteip headers; \
docker-php-ext-enable opcache;
RUN set -eux; \
{ \ { \
echo 'opcache.memory_consumption=128'; \ echo 'opcache.save_comments=1'; \
echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.use_cwd=1'; \
echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.validate_timestamps=1'; \
echo 'opcache.revalidate_freq=2'; \ echo 'opcache.max_accelerated_files=10000'; \
echo 'opcache.revalidate_freq=30'; \
echo 'opcache.revalidate_path=0'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini } > /usr/local/etc/php/conf.d/opcache-recommended.ini
RUN { \ RUN set -eux; \
{ \
echo 'memory_limit=256M'; \
echo 'max_execution_time=240'; \
echo 'max_input_vars=1500'; \
} > /usr/local/etc/php/conf.d/typo3-recommended.ini
RUN set -eux; \
{ \
echo 'post_max_size=10M'; \
echo 'upload_max_filesize=10M'; \
} > /usr/local/etc/php/conf.d/upload-recommended.ini
RUN set -eux; \
{ \
echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \ echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \
echo 'display_errors = Off'; \ echo 'display_errors = Off'; \
echo 'display_startup_errors = Off'; \ echo 'display_startup_errors = Off'; \
@ -118,7 +137,6 @@ RUN { \
} > /usr/local/etc/php/conf.d/error-logging.ini } > /usr/local/etc/php/conf.d/error-logging.ini
RUN set -eux; \ RUN set -eux; \
a2enmod rewrite expires remoteip headers; \
{ \ { \
echo 'RemoteIPHeader X-Forwarded-For'; \ echo 'RemoteIPHeader X-Forwarded-For'; \
# these IP ranges are reserved for "private" use and should thus *usually* be safe inside Docker # these IP ranges are reserved for "private" use and should thus *usually* be safe inside Docker
@ -131,6 +149,8 @@ RUN set -eux; \
a2enconf remoteip; \ a2enconf remoteip; \
find /etc/apache2 -type f -name '*.conf' -exec sed -ri 's/([[:space:]]*LogFormat[[:space:]]+"[^"]*)%h([^"]*")/\1%a\2/g' '{}' + find /etc/apache2 -type f -name '*.conf' -exec sed -ri 's/([[:space:]]*LogFormat[[:space:]]+"[^"]*)%h([^"]*")/\1%a\2/g' '{}' +
RUN cp ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini
# install TYPO3 surf # install TYPO3 surf
# RUN mkdir /usr/local/surf && \ # 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 && \ # curl -L https://github.com/TYPO3/Surf/releases/download/3.4.6/surf.phar -o /usr/local/surf/surf.phar && \

View File

@ -13,6 +13,7 @@ services:
container_name: "${PROJECT_NAME}_typo3" container_name: "${PROJECT_NAME}_typo3"
hostname: "${PROJECT_URL}" hostname: "${PROJECT_URL}"
build: . build: .
user: "1000"
networks: networks:
- "traefik" - "traefik"
- "default" - "default"
@ -22,9 +23,10 @@ services:
- "${PROJECT_DATA}/${PROJECT_NAME}-typo3/protected:/var/www/protected" - "${PROJECT_DATA}/${PROJECT_NAME}-typo3/protected:/var/www/protected"
- "${PROJECT_DATA}/${PROJECT_NAME}-typo3/typo3conf:/var/www/html/typo3conf" - "${PROJECT_DATA}/${PROJECT_NAME}-typo3/typo3conf:/var/www/html/typo3conf"
- "./apache-conf/sites-enabled:/etc/apache2/sites-enabled" - "./apache-conf/sites-enabled:/etc/apache2/sites-enabled"
# - "./php-conf/conf.d:/usr/local/etc/php/conf.d"
- "./php-conf/php.ini:/usr/local/etc/php/php.ini:ro" - "./php-conf/php.ini:/usr/local/etc/php/php.ini:ro"
## use for the first install ## use for the first install
# - "./LICENSE:/var/www/html/FIRST_INSTALL:ro" - "./LICENSE:/var/www/html/FIRST_INSTALL:ro"
- "/etc/timezone:/etc/timezone:ro" - "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
depends_on: depends_on:
@ -50,7 +52,7 @@ services:
- "--collation-server=utf8mb4_unicode_ci" - "--collation-server=utf8mb4_unicode_ci"
env_file: ".env" env_file: ".env"
volumes: volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-typo3/db:/var/lib/mysql" - "${PROJECT_DATA}/${PROJECT_NAME}-typo3/db:/var/lib/mysql"
labels: labels:
# Watchtower add to auto update # Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"

1
init
View File

@ -2,7 +2,6 @@
source ./.env source ./.env
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-typo3/fileadmin mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-typo3/fileadmin
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-typo3/uploads mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-typo3/uploads
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-typo3/protected mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-typo3/protected