Sign inSign up

gleenferdinand/nginx-arm-web

By gleenferdinand

•Updated about 2 months ago

Image
Developer tools
Web servers
Content management system
0

507

gleenferdinand/nginx-arm-web repository overview

⁠Nginx Web Server - ARM Docker Images

A collection of lightweight Nginx + PHP-FPM Docker images built for ARM architectures (e.g. Raspberry Pi, Apple Silicon, ARM-based NAS / servers). Each directory represents a single PHP version, plus a nginxarmall variant that bundles most PHP versions into one image.

These images are the ARM counterpart of the x86_64 images in webserver/nginx/. They share the same host ports as the x86 variant, so run only one variant at a time on the same machine.


⁠Table of Contents


⁠Features

  • Nginx web server that is lightweight, fast, and highly concurrent, built for ARM.
  • PHP-FPM runs separately and is connected to Nginx through a FastCGI socket.
  • Available for PHP 5.6, 7.0, 7.2, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4.
  • The nginxarmall variant bundles multiple PHP versions at once; the active version is selected via the PHP_VERSION environment variable.
  • Built with --platform=linux/arm64, so it runs natively on 64-bit ARM (arm64 / aarch64 / Apple Silicon).
  • Based on Debian bookworm; "EOL" PHP releases (5.6, 7.0, etc.) are provided through the Sury repository (packages.sury.org), which publishes ARM64 packages.
  • The web directory is mounted from the host (./www) so no rebuild is needed when content changes.
  • Access and error logs are sent to stdout / stderr to simplify docker logs.

⁠Directory Structure

webserver/nginx_arm/
├── nginxarm5.6/      # PHP 5.6 ARM64 image
├── nginxarm7.0/      # PHP 7.0 ARM64 image
├── nginxarm7.2/      # PHP 7.2 ARM64 image
├── nginxarm7.4/      # PHP 7.4 ARM64 image
├── nginxarm8.0/      # PHP 8.0 ARM64 image
├── nginxarm8.1/      # PHP 8.1 ARM64 image
├── nginxarm8.2/      # PHP 8.2 ARM64 image
├── nginxarm8.3/      # PHP 8.3 ARM64 image
├── nginxarm8.4/      # PHP 8.4 ARM64 image
└── nginxarmall/      # Multi-PHP-version ARM64 image

Each version directory shares the same structure:

nginxarm8.3/
├── Dockerfile              # Image build definition (linux/arm64)
├── docker-compose.yml      # Run orchestration (port, volume, container name)
├── docker/
│   ├── entrypoint.sh       # Startup: start PHP-FPM + Nginx
│   └── nginx.conf          # Nginx server config (root, index, PHP via FastCGI)
└── www/
    └── index.php           # Sample page (phpinfo)

⁠Technologies Used

ComponentDescription
Web ServerNginx (high-performance web server & reverse proxy)
LanguagePHP-FPM (FastCGI Process Manager)
ProtocolFastCGI (Nginx → PHP-FPM via unix socket)
ArchitectureARM64 (--platform=linux/arm64)
Base ImageDebian bookworm
Extra PHP RepoSury (packages.sury.org) for non-distro PHP versions

⁠Image List

DirectoryPHPContainer NameHost PortBuilt Image
nginxarm5.65.6nginx-arm-php569081nginxarm56-web
nginxarm7.07.0nginx-arm-php709082nginxarm70-web
nginxarm7.27.2nginx-php729083nginxarm72-web
nginxarm7.47.4nginx-php749084nginxarm74-web
nginxarm8.08.0nginx-php809085nginxarm80-web
nginxarm8.18.1nginx-php819086nginxarm81-web
nginxarm8.28.2nginx-php829087nginxarm82-web
nginxarm8.38.3nginx-php839088nginxarm83-web
nginxarm8.48.4nginx-php849089nginxarm84-web
nginxarmall5.6–8.4nginx-all9080gleenferdinand/nginx-arm-web:all

Note: The locally built image name follows the compose folder name (e.g. nginxarm83-web). The nginxarmall variant has an explicit image tag gleenferdinand/nginx-arm-web:all. The nginxarmall bundle includes PHP 5.6, 7.0, 7.2, 7.4, 8.0, 8.1, 8.2, and 8.4 (8.3 is available as a dedicated image above).


⁠Usage

⁠1. Prerequisites

Make sure Docker and Docker Compose v2 are installed, and that you are on an ARM64 machine (runs natively on arm64 / aarch64 / Apple Silicon):

docker --version
docker compose version
uname -m        # should report arm64 or aarch64

Place your web files inside the www/ folder of the relevant directory, or use the bundled sample index.php.

⁠2. Running a Specific Version (e.g. PHP 8.3)
cd webserver/nginx_arm/nginxarm8.3

# Build the image
docker compose build

# Start the container
docker compose up -d

# Check status
docker compose ps

Access it in your browser:

http://localhost:9088

If the bundled www/index.php (phpinfo) is still present, the PHP configuration page will be displayed.

⁠3. Running Other Versions

Repeat the same steps for the version directory you want. Adjust the port according to the table above:

cd webserver/nginx_arm/nginxarm8.4
docker compose build
docker compose up -d
# Access http://localhost:9089
⁠4. Running nginxarmall (all PHP versions)

This image bundles several PHP-FPM versions at once. The default PHP version is determined by the PHP_VERSION environment variable (default 8.4).

cd webserver/nginx_arm/nginxarmall
docker compose build
docker compose up -d

Switching the active PHP version:

# Set PHP_VERSION directly at run time
PHP_VERSION=7.4 docker compose up -d --force-recreate
# Or use .env
docker compose --env-file .env up -d
⁠5. Setting Port & PHP via .env (for nginxarmall)

The nginxarmall/.env file is already available and can be edited:

# Choose PHP version (5.6, 7.0, 7.2, 7.4, 8.0, 8.1, 8.2, 8.4)
PHP_VERSION=7.4

# Port for accessing the web (default 9080)
WORDPRESS_PORT=9080

After editing .env, rerun:

docker compose up -d --force-recreate

⁠How the Image Works

When the container starts, entrypoint.sh performs several steps:

  1. Creates the /run/php directory for PHP-FPM sockets.
  2. Starts PHP-FPM:
    • Specific version: php-fpm<v> matching the version in that directory.
    • nginxarmall: starts all php-fpm5.6 … php-fpm8.4, then rewrites nginx.conf to point the .php handler to the $PHP_VERSION socket.
  3. Runs Nginx in the foreground: nginx -g 'daemon off;'.

Web request flow:

Browser ──HTTP──▶ Nginx ──FastCGI socket──▶ php-fpm<v> ──▶ /var/www/html

⁠Configuration

⁠docker/nginx.conf

A single server block that:

  • Listens on port 80 and serves the document root /var/www/html.
  • Uses index.php as the default index file.
  • Sends access/error logs to /dev/stdout and /dev/stderr.
  • Routes requests with the try_files rewriting to index.php for pretty URLs / SPA-style routing.
  • Passes .php files to PHP-FPM via fastcgi_pass unix:/run/php/php8.3-fpm.sock (version-specific in each image).
  • Denies access to .ht files for security.
⁠Volume
  • ./www:/var/www/html — your web content. Changes on the host are visible in the container immediately.

⁠Verification

Check container status & logs:

docker ps | grep nginx
docker logs <container_name>          # e.g. docker logs nginx-php83

Test the page response:

curl -i http://localhost:9088

Check the active PHP version (if www/index.php contains phpinfo()):

curl -s http://localhost:9088 | grep -i "PHP Version"

⁠Troubleshooting

SymptomSolution
Port already in useChange the port in docker-compose.yml (the ports section).
Blank page / .php extension downloadedMake sure PHP-FPM is running; check docker logs <container>.
Wrong architecture / exec format errorThese images require an ARM64 host. On x86_64 use the webserver/nginx/ variant instead.
php-fpm<v>: not foundEnsure the PHP version is actually installed in the image (or use the nginxarmall variant).
Old PHP version missing from Debian repoThe image uses the Sury repo; make sure the build uses docker compose build --pull.
Want to reset / stopRun docker compose down, then docker compose up -d to start again.
Configuration changes not appliedFiles in docker/ are only read at build time; after editing them you must run docker compose build again.

Note: This directory is the ARM64 webserver variant (linux/arm64). For x86_64 / amd64 machines (e.g. desktop PCs, most cloud VPS), use the webserver/nginx/ directory in the same repository.

Tag summary

Content type

Image

Digest

sha256:35ecf436b…

Size

125.2 MB

Last updated

about 2 months ago

docker pull gleenferdinand/nginx-arm-web