├── .github ├── dependabot.yml └── workflows │ ├── build.yaml │ └── dockerhub-description.yaml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── SECURITY.md ├── config ├── fpm-pool.conf ├── nginx.conf ├── php.ini └── supervisord.conf ├── docker-compose.test.yml ├── docker-compose.yml ├── entrypoint.sh ├── run_tests.sh ├── wp-cli.yml └── wp-config.php /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | - package-ecosystem: "docker" 8 | directory: "/" 9 | schedule: 10 | interval: "weekly" 11 | groups: 12 | docker-updates: 13 | update-types: 14 | - "patch" 15 | - "minor" 16 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: Test & build Docker image 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | tags: ["*"] 7 | pull_request: 8 | 9 | env: 10 | IMAGE_NAME: trafex/wordpress 11 | IMAGE_TAG: ${{ github.sha }} 12 | DOCKER_BUILDKIT: 1 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | 22 | - name: Set up QEMU 23 | uses: docker/setup-qemu-action@v3 24 | 25 | - name: Set up Docker Buildx 26 | id: buildx 27 | uses: docker/setup-buildx-action@v3 28 | 29 | - name: Build image 30 | run: |- 31 | docker build -t $IMAGE_NAME:$IMAGE_TAG . 32 | 33 | - name: Smoke test image 34 | run: |- 35 | docker compose -f docker-compose.test.yml up -d wordpress 36 | docker compose -f docker-compose.test.yml run sut 37 | 38 | - name: Run Trivy vulnerability scanner 39 | uses: aquasecurity/trivy-action@master 40 | with: 41 | image-ref: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" 42 | format: "template" 43 | template: "@/contrib/sarif.tpl" 44 | output: "trivy-results.sarif" 45 | 46 | - name: Upload Trivy scan results to GitHub Security tab 47 | if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') 48 | uses: github/codeql-action/upload-sarif@v3 49 | with: 50 | sarif_file: "trivy-results.sarif" 51 | 52 | - name: Login to Docker Hub 53 | if: (github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule' )) || contains(github.ref, 'refs/tags/') 54 | uses: docker/login-action@v3 55 | with: 56 | username: ${{ secrets.DOCKERHUB_USERNAME }} 57 | password: ${{ secrets.DOCKERHUB_TOKEN }} 58 | 59 | - name: Build multi-arch image and push latest tag 60 | if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') 61 | run: |- 62 | docker buildx build \ 63 | --cache-from=$IMAGE_NAME:latest \ 64 | --push \ 65 | -t $IMAGE_NAME:latest \ 66 | --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \ 67 | . 68 | 69 | - name: Set tag in environment 70 | if: contains(github.ref, 'refs/tags/') 71 | run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 72 | 73 | - name: Build multi-arch image and push release tag 74 | if: contains(github.ref, 'refs/tags/') 75 | run: |- 76 | docker buildx build \ 77 | --cache-from=$IMAGE_NAME:latest \ 78 | --push \ 79 | -t $IMAGE_NAME:$RELEASE_VERSION \ 80 | --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \ 81 | . 82 | -------------------------------------------------------------------------------- /.github/workflows/dockerhub-description.yaml: -------------------------------------------------------------------------------- 1 | name: Update Docker Hub Description 2 | on: 3 | push: 4 | branches: 5 | - master 6 | paths: 7 | - README.md 8 | - .github/workflows/dockerhub-description.yml 9 | jobs: 10 | dockerHubDescription: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | 15 | - name: Docker Hub Description 16 | uses: peter-evans/dockerhub-description@v4 17 | with: 18 | username: ${{ secrets.DOCKERHUB_USERNAME }} 19 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 20 | repository: trafex/wordpress 21 | short-description: ${{ github.event.repository.description }} 22 | 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.21 2 | LABEL Maintainer="Tim de Pater " \ 3 | Description="Lightweight WordPress container with Nginx 1.26 & PHP-FPM 8.4 based on Alpine Linux." 4 | 5 | # Install packages 6 | RUN apk --no-cache add \ 7 | php84 \ 8 | php84-fpm \ 9 | php84-mysqli \ 10 | php84-json \ 11 | php84-openssl \ 12 | php84-curl \ 13 | php84-zlib \ 14 | php84-xml \ 15 | php84-phar \ 16 | php84-intl \ 17 | php84-dom \ 18 | php84-xmlreader \ 19 | php84-xmlwriter \ 20 | php84-exif \ 21 | php84-fileinfo \ 22 | php84-sodium \ 23 | php84-gd \ 24 | php84-simplexml \ 25 | php84-ctype \ 26 | php84-mbstring \ 27 | php84-zip \ 28 | php84-opcache \ 29 | php84-iconv \ 30 | php84-pecl-imagick \ 31 | php84-session \ 32 | php84-tokenizer \ 33 | nginx \ 34 | supervisor \ 35 | curl \ 36 | bash \ 37 | less 38 | 39 | # Configure nginx 40 | COPY config/nginx.conf /etc/nginx/nginx.conf 41 | 42 | # Configure PHP-FPM 43 | COPY config/fpm-pool.conf /etc/php84/php-fpm.d/zzz_custom.conf 44 | COPY config/php.ini /etc/php84/conf.d/zzz_custom.ini 45 | 46 | # Configure supervisord 47 | COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 48 | 49 | RUN ln -s /usr/bin/php84 /usr/bin/php 50 | 51 | # wp-content volume 52 | VOLUME /var/www/wp-content 53 | WORKDIR /var/www/wp-content 54 | RUN chown -R nobody:nobody /var/www 55 | 56 | # WordPress 57 | ENV WORDPRESS_VERSION 6.8.1 58 | ENV WORDPRESS_SHA1 52d5f05c96a9155f78ed84700264307e5dea14b4 59 | 60 | RUN mkdir -p /usr/src 61 | 62 | # Upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress 63 | RUN curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz \ 64 | && echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c - \ 65 | && tar -xzf wordpress.tar.gz -C /usr/src/ \ 66 | && rm wordpress.tar.gz \ 67 | && chown -R nobody:nobody /usr/src/wordpress 68 | 69 | # Add WP CLI 70 | ENV WP_CLI_CONFIG_PATH /usr/src/wordpress/wp-cli.yml 71 | RUN curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ 72 | && chmod +x /usr/local/bin/wp 73 | COPY --chown=nobody:nobody wp-cli.yml /usr/src/wordpress/ 74 | 75 | # WP config 76 | COPY --chown=nobody:nobody wp-config.php /usr/src/wordpress 77 | RUN chmod 640 /usr/src/wordpress/wp-config.php 78 | 79 | # Link wp-secrets to location on wp-content 80 | RUN ln -s /var/www/wp-content/wp-secrets.php /usr/src/wordpress/wp-secrets.php 81 | 82 | # Entrypoint to copy wp-content 83 | COPY entrypoint.sh /entrypoint.sh 84 | ENTRYPOINT [ "/entrypoint.sh" ] 85 | 86 | EXPOSE 80 87 | 88 | CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] 89 | 90 | HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1/wp-login.php 91 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Tim de Pater 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # WordPress Docker Container 3 | 4 | Lightweight WordPress container with Nginx 1.26 & PHP-FPM 8.4 based on Alpine Linux. 5 | 6 | _WordPress version currently installed:_ **6.8.1** 7 | 8 | * Used in production for many sites, making it stable, tested and up-to-date 9 | * Optimized for 100 concurrent users 10 | * Optimized to only use resources when there's traffic (by using PHP-FPM's ondemand PM) 11 | * Works with Amazon Cloudfront or CloudFlare as SSL terminator and CDN 12 | * Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64 13 | * Built on the lightweight Alpine Linux distribution 14 | * Small Docker image size (+/-90MB) 15 | * Uses PHP 8.4 for the best performance, low cpu usage & memory footprint 16 | * Can safely be updated without losing data 17 | * Fully configurable because wp-config.php uses the environment variables you can pass as an argument to the container 18 | 19 | [![Docker Pulls](https://img.shields.io/docker/pulls/trafex/wordpress.svg)](https://hub.docker.com/r/trafex/wordpress/) 20 | ![nginx 1.26](https://img.shields.io/badge/nginx-1.26-brightgreen.svg) 21 | ![php 8.4](https://img.shields.io/badge/php-8.4-brightgreen.svg) 22 | ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg) 23 | 24 | ## [![Trafex Consultancy](https://timdepater.com/logo/mini-logo.png)](https://timdepater.com?mtm_campaign=github) 25 | I can help you with [Containerization, Kubernetes, Monitoring, Infrastructure as Code and other DevOps challenges](https://timdepater.com/?mtm_campaign=github). 26 | 27 | ## Usage 28 | See [docker-compose.yml](https://github.com/TrafeX/docker-wordpress/blob/master/docker-compose.yml) how to use it in your own environment. 29 | 30 | docker-compose up 31 | 32 | Or 33 | 34 | docker run -d -p 80:80 -v /local/folder:/var/www/wp-content \ 35 | -e "DB_HOST=db" \ 36 | -e "DB_NAME=wordpress" \ 37 | -e "DB_USER=wp" \ 38 | -e "DB_PASSWORD=secret" \ 39 | -e "FS_METHOD=direct" \ 40 | trafex/wordpress 41 | 42 | ### WP-CLI 43 | 44 | This image includes [wp-cli](https://wp-cli.org/) which can be used like this: 45 | 46 | docker exec /usr/local/bin/wp --path=/usr/src/wordpress 47 | 48 | 49 | ## Inspired by 50 | 51 | * https://hub.docker.com/_/wordpress/ 52 | * https://codeable.io/wordpress-developers-intro-to-docker-part-two/ 53 | * https://github.com/TrafeX/docker-php-nginx/ 54 | * https://github.com/etopian/alpine-php-wordpress 55 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | This image follows the [Supported Versions from WordPress](https://codex.wordpress.org/Supported_Versions). 5 | 6 | ## Reporting a Vulnerability 7 | Found a potential vulnerability? Report it by e-mail on security@trafex.nl. 8 | 9 | -------------------------------------------------------------------------------- /config/fpm-pool.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | ; Log to stderr 3 | error_log = /dev/stderr 4 | 5 | [www] 6 | ; Enable status page 7 | pm.status_path = /fpm-status 8 | 9 | ; Ondemand process manager 10 | pm = ondemand 11 | 12 | ; The number of child processes to be created when pm is set to 'static' and the 13 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 14 | ; This value sets the limit on the number of simultaneous requests that will be 15 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 16 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 17 | ; CGI. The below defaults are based on a server without much resources. Don't 18 | ; forget to tweak pm.* to fit your needs. 19 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 20 | ; Note: This value is mandatory. 21 | pm.max_children = 100 22 | 23 | ; The number of seconds after which an idle process will be killed. 24 | ; Note: Used only when pm is set to 'ondemand' 25 | ; Default Value: 10s 26 | pm.process_idle_timeout = 10s; 27 | 28 | ; The number of requests each child process should execute before respawning. 29 | ; This can be useful to work around memory leaks in 3rd party libraries. For 30 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 31 | ; Default Value: 0 32 | pm.max_requests = 1000 33 | 34 | ; Make sure the FPM workers can reach the environment variables for configuration 35 | clear_env = no 36 | 37 | ; Catch output from PHP 38 | catch_workers_output = yes 39 | 40 | ; Remove the 'child 10 said into stderr' prefix in the log and only show the actual message 41 | decorate_workers_output = no 42 | 43 | ; Enable ping page to use in healthcheck 44 | ping.path = /fpm-ping -------------------------------------------------------------------------------- /config/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes 1; 2 | pid /run/nginx.pid; 3 | 4 | events { 5 | worker_connections 1024; 6 | } 7 | 8 | http { 9 | include mime.types; 10 | # Threat files with a unknown filetype as binary 11 | default_type application/octet-stream; 12 | 13 | log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" ' 14 | '$status $body_bytes_sent "$http_referer" ' 15 | '"$http_user_agent" "$http_x_forwarded_for" ' 16 | '$request_time $upstream_response_time $pipe $upstream_cache_status'; 17 | 18 | access_log /dev/stdout main_timed; 19 | error_log /dev/stderr notice; 20 | 21 | keepalive_timeout 65; 22 | 23 | # Hide headers that identify the server to prevent information leakage 24 | proxy_hide_header X-Powered-By; 25 | fastcgi_hide_header X-Powered-By; 26 | server_tokens off; 27 | 28 | # Enable gzip compression 29 | gzip on; 30 | gzip_disable "msie6"; 31 | gzip_proxied any; 32 | # Based on CloudFlare's recommended settings 33 | gzip_types text/richtext text/plain text/css text/x-script text/x-component text/x-java-source text/x-markdown application/javascript application/x-javascript text/javascript text/js image/x-icon image/vnd.microsoft.icon application/x-perl application/x-httpd-cgi text/xml application/xml application/rss+xml application/vnd.api+json application/x-protobuf application/json multipart/bag multipart/mixed application/xhtml+xml font/ttf font/otf font/x-woff image/svg+xml application/vnd.ms-fontobject application/ttf application/x-ttf application/otf application/x-otf application/truetype application/opentype application/x-opentype application/font-woff application/eot application/font application/font-sfnt application/wasm application/javascript-binast application/manifest+json application/ld+json application/graphql+json application/geo+json; 34 | gzip_vary on; 35 | 36 | # Forward the cloudfront scheme from upstream 37 | map "$http_cloudfront_forwarded_proto$http_x_forwarded_proto" $forwarded_scheme { 38 | default off; 39 | "~*(https)" on; 40 | } 41 | 42 | server { 43 | listen [::]:80 default_server; 44 | listen 80 default_server; 45 | server_name _; 46 | 47 | sendfile off; 48 | 49 | # Increase proxy buffers for large requests 50 | proxy_buffer_size 128k; 51 | proxy_buffers 4 256k; 52 | proxy_busy_buffers_size 256k; 53 | 54 | # Upload limit 55 | client_max_body_size 50m; 56 | client_body_buffer_size 128k; 57 | 58 | root /usr/src/wordpress; 59 | index index.php; 60 | 61 | # redirect server error pages to the static page /50x.html 62 | error_page 500 502 503 504 /50x.html; 63 | location = /50x.html { 64 | root /var/lib/nginx/html; 65 | } 66 | 67 | location = /favicon.ico { 68 | log_not_found off; 69 | access_log off; 70 | } 71 | 72 | location = /robots.txt { 73 | log_not_found off; 74 | access_log off; 75 | } 76 | 77 | # Based on https://codeable.io/wordpress-developers-intro-to-docker-part-two/ 78 | location /wp-content { 79 | root /var/www; 80 | expires 7d; 81 | add_header Cache-Control "public"; 82 | } 83 | 84 | location / { 85 | # First attempt to serve request as file, then 86 | # as directory, then fall back to index.php 87 | try_files $uri $uri/ /index.php$is_args$args; 88 | } 89 | 90 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 91 | location ~ \.php$ { 92 | try_files $uri =404; 93 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 94 | 95 | #fastcgi_intercept_errors on; 96 | fastcgi_buffer_size 128k; 97 | fastcgi_buffers 4 256k; 98 | fastcgi_busy_buffers_size 256k; 99 | 100 | fastcgi_index index.php; 101 | fastcgi_pass 127.0.0.1:9000; 102 | 103 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 104 | include fastcgi_params; 105 | 106 | # Forward the scheme from upstream 107 | fastcgi_param HTTPS $forwarded_scheme; 108 | } 109 | 110 | # deny access to . files, for security 111 | location ~ /\. { 112 | log_not_found off; 113 | deny all; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /config/php.ini: -------------------------------------------------------------------------------- 1 | ; Redirect errors to the container stderr 2 | error_log = "/dev/stderr" 3 | 4 | ; Make sure _ENV is populated to use it in wp-config.php 5 | variables_order = "EGPCS" 6 | 7 | ; Hide PHP version info in response headers 8 | expose_php = Off 9 | 10 | ; Up the upload limit 11 | post_max_size = 50M 12 | upload_max_filesize = 50M 13 | 14 | ; Increase default memory limit, required for Woocommce 15 | memory_limit = 256M 16 | 17 | [Date] 18 | ; Set default timezone, you can configure the timezone in Wordpress 19 | date.timezone = "UTC" 20 | -------------------------------------------------------------------------------- /config/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord.log 4 | pidfile=/run/supervisord.pid 5 | 6 | [program:php-fpm] 7 | command=php-fpm84 -F 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | autorestart=false 12 | startretries=0 13 | 14 | [program:nginx] 15 | command=nginx -g 'daemon off;' 16 | stdout_logfile=/dev/stdout 17 | stdout_logfile_maxbytes=0 18 | redirect_stderr=true 19 | autorestart=false 20 | startretries=0 21 | -------------------------------------------------------------------------------- /docker-compose.test.yml: -------------------------------------------------------------------------------- 1 | services: 2 | db: 3 | image: mariadb:11 4 | environment: 5 | MYSQL_ROOT_PASSWORD: wordpress 6 | MYSQL_DATABASE: wordpress 7 | MYSQL_USER: wordpress 8 | MYSQL_PASSWORD: wordpress 9 | 10 | wordpress: 11 | depends_on: 12 | - db 13 | build: ./ 14 | image: ${IMAGE_NAME}:${IMAGE_TAG} 15 | environment: 16 | DB_HOST: db 17 | DB_PASSWORD: wordpress 18 | DB_NAME: wordpress 19 | DB_USER: wordpress 20 | WORDPRESS_SITE_URL: http://localhost 21 | FS_METHOD: direct 22 | 23 | sut: 24 | image: alpine:3.21 25 | depends_on: 26 | - wordpress 27 | command: /tmp/run_tests.sh 28 | volumes: 29 | - "./run_tests.sh:/tmp/run_tests.sh:ro" 30 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | db: 3 | image: mariadb:11 4 | volumes: 5 | - "db-data:/var/lib/mysql" 6 | environment: 7 | MYSQL_ROOT_PASSWORD: wordpress 8 | MYSQL_DATABASE: wordpress 9 | MYSQL_USER: wordpress 10 | MYSQL_PASSWORD: wordpress 11 | 12 | wordpress: 13 | depends_on: 14 | - db 15 | build: ./ 16 | volumes: 17 | - "site-data:/var/www/wp-content" 18 | ports: 19 | - "8123:80" 20 | environment: 21 | DB_HOST: db 22 | DB_PASSWORD: wordpress 23 | DB_NAME: wordpress 24 | DB_USER: wordpress 25 | WORDPRESS_SITE_URL: http://localhost:8123 26 | FS_METHOD: direct 27 | # For debugging only: 28 | #WP_DEBUG: "true" 29 | #WP_DEBUG_DISPLAY: "true" 30 | 31 | volumes: 32 | db-data: 33 | site-data: 34 | 35 | networks: 36 | default: 37 | driver: bridge 38 | ipam: 39 | driver: default 40 | config: 41 | - subnet: 192.168.91.0/24 42 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # terminate on errors 4 | set -e 5 | 6 | # Check if volume is empty 7 | if [ ! "$(ls -A "/var/www/wp-content" 2>/dev/null)" ]; then 8 | echo 'Setting up wp-content volume' 9 | # Copy wp-content from Wordpress src to volume 10 | cp -r /usr/src/wordpress/wp-content /var/www/ 11 | chown -R nobody:nobody /var/www 12 | fi 13 | # Check if wp-secrets.php exists 14 | if ! [ -f "/var/www/wp-content/wp-secrets.php" ]; then 15 | echo ' /var/www/wp-content/wp-secrets.php 16 | # Check that secrets environment variables are not set 17 | if [ ! $AUTH_KEY ] \ 18 | && [ ! $SECURE_AUTH_KEY ] \ 19 | && [ ! $LOGGED_IN_KEY ] \ 20 | && [ ! $NONCE_KEY ] \ 21 | && [ ! $AUTH_SALT ] \ 22 | && [ ! $SECURE_AUTH_SALT ] \ 23 | && [ ! $LOGGED_IN_SALT ] \ 24 | && [ ! $NONCE_SALT ]; then 25 | echo "Generating wp-secrets.php" 26 | # Generate secrets 27 | curl -f https://api.wordpress.org/secret-key/1.1/salt/ >> /var/www/wp-content/wp-secrets.php 28 | fi 29 | fi 30 | exec "$@" 31 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | apk --no-cache add curl 3 | for i in $(seq 1 10); do curl -fs wordpress > /dev/null && break || { echo -n '.'; sleep 1; }; done; 4 | curl --silent --fail http://wordpress/wp-admin/install.php | grep 'wp-core-ui' 5 | -------------------------------------------------------------------------------- /wp-cli.yml: -------------------------------------------------------------------------------- 1 | # This file is used by the wp-cli tool to define the path to the WordPress installation 2 | path: /usr/src/wordpress -------------------------------------------------------------------------------- /wp-config.php: -------------------------------------------------------------------------------- 1 | $value) { 9 | $capitalized = strtoupper($key); 10 | if (!defined($capitalized)) { 11 | // Convert string boolean values to actual booleans 12 | if (in_array($value, ['true', 'false'])) { 13 | $value = filter_var($value, FILTER_VALIDATE_BOOLEAN); 14 | } 15 | 16 | define($capitalized, $value); 17 | } 18 | } 19 | 20 | if (!defined('ABSPATH')) { 21 | define('ABSPATH', dirname(__FILE__) . '/'); 22 | } 23 | 24 | require_once(ABSPATH . 'wp-secrets.php'); 25 | require_once(ABSPATH . 'wp-settings.php'); 26 | --------------------------------------------------------------------------------