|
6 | 6 | # - tout le dynamique proxifié vers le backend FastAPI (honeypot-http:8080). |
7 | 7 | FROM debian:bookworm-slim |
8 | 8 |
|
9 | | -# Apache + extraction des SEULS fichiers statiques de WordPress 6.5.2 (pas de .php : |
10 | | -# sans mod_php, Apache divulguerait sinon le code source des .php). |
| 9 | +# Apache + assets WordPress 6.5.2. On copie wp-includes/wp-content/wp-admin puis on |
| 10 | +# SUPPRIME tout fichier non statique (dont les .php) : sans mod_php, Apache en |
| 11 | +# servirait sinon le code source. (cd évité => hadolint DL3003.) |
11 | 12 | # hadolint ignore=DL3008,DL3015 |
12 | 13 | RUN apt-get update \ |
13 | 14 | && apt-get install -y --no-install-recommends apache2 ca-certificates curl unzip \ |
14 | 15 | && a2enmod proxy proxy_http headers rewrite \ |
15 | 16 | && curl -fsSL https://wordpress.org/wordpress-6.5.2.zip -o /tmp/wp.zip \ |
16 | 17 | && unzip -q /tmp/wp.zip -d /tmp \ |
17 | | - && cd /tmp/wordpress \ |
18 | | - && find wp-includes wp-content wp-admin -type f \ |
19 | | - \( -name '*.css' -o -name '*.js' -o -name '*.map' -o -name '*.png' -o -name '*.jpg' \ |
20 | | - -o -name '*.jpeg' -o -name '*.gif' -o -name '*.svg' -o -name '*.ico' \ |
21 | | - -o -name '*.woff' -o -name '*.woff2' -o -name '*.ttf' -o -name '*.eot' \) \ |
22 | | - -exec cp --parents -t /var/www/html {} + \ |
23 | | - && cp readme.html license.txt /var/www/html/ \ |
| 18 | + && cp -r /tmp/wordpress/wp-includes /tmp/wordpress/wp-content /tmp/wordpress/wp-admin /var/www/html/ \ |
| 19 | + && cp /tmp/wordpress/readme.html /tmp/wordpress/license.txt /var/www/html/ \ |
| 20 | + && find /var/www/html -type f ! \( -name '*.css' -o -name '*.js' -o -name '*.mjs' -o -name '*.map' \ |
| 21 | + -o -name '*.json' -o -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' -o -name '*.gif' \ |
| 22 | + -o -name '*.svg' -o -name '*.ico' -o -name '*.woff' -o -name '*.woff2' -o -name '*.ttf' \ |
| 23 | + -o -name '*.eot' -o -name '*.html' -o -name '*.txt' \) -delete \ |
| 24 | + && find /var/www/html -type d -empty -delete \ |
24 | 25 | && chown -R www-data:www-data /var/www/html \ |
25 | 26 | && sed -i 's/^ServerTokens .*/ServerTokens OS/' /etc/apache2/conf-available/security.conf \ |
26 | 27 | && sed -i 's/^ServerSignature .*/ServerSignature On/' /etc/apache2/conf-available/security.conf \ |
|
0 commit comments