Skip to content

sports-match-maker/docker-pnmamhes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker-PNMAMHES

Is a reusable docker dev-box for multiple frameworks in PHP technology.

Preview Link

Dev-box technology stack

  • PHP 8.1
  • MySql
  • Redis
  • ElasticSearch
  • Kibana
  • Adminer
  • Nginx
  • MailPit

Supported frameworks

*Note: Currently all frameworks support PHP8.1

Repository skeleton

.
├── LICENSE
├── README.md
├── docker
│   ├── db    ---> database init sql script
│   ├── nginx ---> nginx server config file for new project
│   ├── php   ---> edit php versions and packages/extensions
│   └── redis ---> redis local beck up
├── docker-compose.yaml ---> edit volumes, ports, etc.
└── src                 ---> put your new projects
    ├── codeigniter     ---> supported framework
    ├── laravel         ---> supported framework
    ├── slim            ---> supported framework
    ├── symfony         ---> supported framework
    └── yii             ---> supported framework

Extensibility and Reusability

It's totally up to you to make replacements

  • for example MySQL -> PgSql or MongoDB
  • for example MailPit -> MailHog
  • even to make a clean-up to satisfy your needs.

PHP version upgrade

The change is trivial and is located here

FROM php:8.1-fpm to FROM php:8.2-fpm or FROM php:7.4-fpm

Clean up

  • Go to the default configuration for Nginx here and configure the servers as many projects as with you have in your repo.
  • Go to the init.sql configuration for databases here and make the changes
  • Register the projects as follows here

For example

php-fpm:
    container_name: php
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    volumes:
      - ./src/laravel:/var/www/html/laravel
      - ./src/symfony:/var/www/html/symfony
      - ./src/codeigniter:/var/www/html/codeigniter
      - ./src/slim:/var/www/html/slim
      - ./src/yii:/var/www/html/yii
    networks:
      - docker-pnmamhes

  nginx:
    container_name: nginx
    image: nginx:stable
    ports:
      - '80:80'
      - '81:81'
      - '82:82'
      - '83:83'
      - '84:84'
    volumes:
      - ./src/laravel:/var/www/html/laravel 
      - ./src/symfony:/var/www/html/symfony
      - ./src/codeigniter:/var/www/html/codeigniter
      - ./src/slim:/var/www/html/slim
      - ./src/yii:/var/www/html/yii
      - ./docker/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
    networks:
      - docker-pnmamhes