Sign inSign up

lumaprints/dockerbase

By lumaprints

•Updated 5 days ago

Quick and dirty docker container for testing disposable apps.

Image
0

10K+

lumaprints/dockerbase repository overview

⁠Base Docker Image for Lumaprints Applications

  • Built on the lightweight and secure Alpine Linux distribution
  • Multi-platform, supporting AMD64, ARMv6, ARMv7, ARM64
  • Very small Docker image size
  • Supports PHP 8.1, 8.2, 8.3, 8.4, and 8.5
  • Optimized to only use resources when there's traffic (using PHP-FPM's on-demand process manager)
  • All services (Nginx, PHP-FPM, supercronic, supervisord) run under a non-privileged user (nobody)
  • Cron support via supercronic⁠ — runs as non-root, logs to stdout
  • All logs are redirected to Docker container output (visible with docker logs -f <container>)
  • Follows the KISS principle (Keep It Simple, Stupid)

⁠Available Tags

TagPHPAlpine
lumaprints/dockerbase:php85-latest8.53.23
lumaprints/dockerbase:php84-latest8.43.23
lumaprints/dockerbase:php83-latest8.33.23
lumaprints/dockerbase:php82-latest8.23.22
lumaprints/dockerbase:php81-latest8.13.19

⁠Usage

Use as a base image in your Dockerfile:

FROM lumaprints/dockerbase:php84-latest

⁠Building Locally

A helper script is included that maps PHP versions to the correct Alpine version:

./build.sh 84    # Builds PHP 8.4 on Alpine 3.23
./build.sh 83    # Builds PHP 8.3 on Alpine 3.23

Or build directly with Docker:

docker build --build-arg PHP_VERSION=84 --build-arg ALPINE_VERSION=3.23 -t dockerbase:php84 .

⁠Configuration

Default configuration files live in config/⁠. Override them by mounting your own:

Nginx:

docker run -v "$(pwd)/nginx.conf:/etc/nginx/nginx.conf" lumaprints/dockerbase:php84-latest

PHP:

docker run -v "$(pwd)/php.ini:/etc/php84/conf.d/custom.ini" lumaprints/dockerbase:php84-latest

PHP-FPM:

docker run -v "$(pwd)/fpm-pool.conf:/etc/php84/php-fpm.d/www.conf" lumaprints/dockerbase:php84-latest

⁠Cron Jobs

The image includes supercronic⁠ for running cron jobs without root. The default crontab at /etc/crontab is empty.

Add cron entries in a derived image:

FROM lumaprints/dockerbase:php84-latest
COPY my-crontab /etc/crontab

Or mount at runtime:

docker run -v "$(pwd)/my-crontab:/etc/crontab" lumaprints/dockerbase:php84-latest

Example crontab:

* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1

⁠Adding Composer

COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer install --optimize-autoloader --no-interaction --no-progress

Tag summary

Content type

Image

Digest

sha256:1f3436b7c…

Size

65.4 MB

Last updated

5 days ago

docker pull lumaprints/dockerbase:php84-latest