Sign inSign up

pinesand/ub-php-nginx

By pinesand

•Updated 5 months ago

Ubuntu 24.04 + PHP 8.3 FPM + Nginx base for Laravel: Composer, Node 20 & Supervisor

Image
Languages & frameworks
Developer tools
Web servers
0

123

pinesand/ub-php-nginx repository overview

Ubuntu 24.04 · PHP 8.3-FPM · Nginx · Laravel-oriented runtime — application not included.

This image is meant as a FROM base: install dependencies and bake your Laravel app in a child image or pipeline. Ships with Composer and Node.js 20 so you can run composer install and frontend builds without extra tooling layers unless you trim them yourself.


⁠Highlights
  • PHP 8.3 (FPM + CLI) with common extensions — MySQL, PostgreSQL, Redis, Memcached, OPcache, and more typical for Laravel stacks
  • Nginx preconfigured for a Laravel public/ document root (try_files, PHP-FPM socket, Laravel-friendly timeouts)
  • Supervisor runs nginx, php-fpm, and sshd
  • Composer global + Node.js 20 (NodeSource) for Mix/Vite-style builds
  • Timezone: Asia/Singapore (UTC+8)
  • Health check path: /health (plain text OK response)

⁠Ports
PortService
80HTTP (Nginx)
22SSH (optional ops use; tighten for production)

⁠Quick run (smoke test)
docker run --rm -p 8080:80 your-namespace/your-repo:tag
curl -sf http://localhost:8080/health

Default content at / is a small placeholder until you mount or copy a real public/.


⁠Use as a parent image
FROM your-namespace/your-repo:tag

WORKDIR /var/www/laravel
COPY --chown=www-data:www-data . .

RUN composer install --no-dev --optimize-autoloader --no-interaction
# If you use Vite/Mix assets:
RUN if [ -f package.json ]; then npm ci && npm run build; fi

# App-specific permissions, Supervisor programs, env, etc.

Bring your .env, encryption key, DB/Redis URLs, and any worker / Reverb processes in this layer — the base deliberately stays generic.


⁠Build arguments
ArgumentPurpose
BASE_SSH_USERLogin name for sudo/SSH user (default sysadmin)
BASE_SSH_PASSWORDSSH password — always override for anything beyond local dev
docker build \
  --build-arg BASE_SSH_USER=sysadmin \
  --build-arg BASE_SSH_PASSWORD='your-strong-password' \
  -t your-namespace/your-repo:tag .

⁠Compose (this repository)

Optional local build/run:

docker compose up --build -d

Maps 3082 → 80 and 3023 → 22 by default (docker-compose.yml).


⁠Tags & versioning

Tag summary

Content type

Image

Digest

sha256:f6387ae28…

Size

326.3 MB

Last updated

5 months ago

docker pull pinesand/ub-php-nginx:1.0