Sign inSign up

jcadima/laravel-php

By jcadima

•Updated about 1 year ago

PHP 8.2-FPM Docker image for Laravel apps with common extensions and Composer baked in.

Image
Languages & frameworks
Developer tools
0

231

jcadima/laravel-php repository overview

⁠Laravel PHP 8.2-FPM Docker Image

A developer-friendly PHP 8.2-FPM Docker image built specifically for Laravel applications. Comes with all the essential extensions and tools you need, plus runs as a non-root user for better security.

Quick guide available here⁠

⁠What's Inside

  • PHP 8.2-FPM - Latest PHP 8.2 with FastCGI Process Manager
  • Laravel-ready extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, gd, zip, intl, opcache
  • Composer 2 - Pre-installed and ready to use
  • Non-root user - Runs as admin user (uid: 1001) for security
  • Development tools - git, curl, zip, unzip included

⁠example docker-compose.yml

services:
  # PHP-FPM Application Container
  app:
    image: jcadima/laravel-php:8.2
    container_name: laravel-app
    restart: unless-stopped
    working_dir: /var/www/laravel
    volumes:
      - ./src:/var/www/laravel:delegated  # Use delegated for better performance on macOS
    environment:
      - PHP_IDE_CONFIG=serverName=laravel-docker
    networks:
      - laravel-net
    depends_on:
      - db

  # Nginx Web Server
  nginx:
    image: nginx:1.23-alpine
    container_name: laravel-nginx
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - ./src:/var/www/laravel:delegated
      - ./docker-compose/nginx/http.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - laravel-net
    depends_on:
      - app

  # MySQL Database
  db:
    image: mysql:8
    container_name: laravel-db
    restart: unless-stopped
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: "laravel"
      MYSQL_USER: "laravel"
      MYSQL_PASSWORD: "secret"
      MYSQL_ROOT_PASSWORD: "secret"
    volumes:
      - db-data:/var/lib/mysql
      - ./docker-compose/mysql/init:/docker-entrypoint-initdb.d  # Optional: Custom init scripts
    networks:
      - laravel-net
    command: --default-authentication-plugin=mysql_native_password


volumes:
  db-data:
    driver: local


networks:
  laravel-net:
    driver: bridge

Tag summary

Content type

Image

Digest

sha256:6b1d92c3a…

Size

215.3 MB

Last updated

about 1 year ago

docker pull jcadima/laravel-php:8.2