Sign inSign up

bananabb/php

By bananabb

Updated almost 2 years ago

Setup php environment with packages and composer

Image
0

1.3K

bananabb/php repository overview

php

This repository contains Dockerfile of nginx, php in ubuntu.

Getting Started

These instructions will get you to build php service with nginx in your docker. See Installation for notes on how to build your ubuntu on a live system.

Installation
  1. Install Docker.
  2. Download automated build from public Docker Hub or run Usage tag provided.
  3. Default working directory located in /var/www/html, you can setup specifically
  4. Finally, to verify the php and nginx is ready as expected, open http://your_server_ip:8080/info.php or http://your_server_ip:8080 in your browser of choice, after running up the Usage.
  5. The verify will be depended on your work. If you use volumes (e.g: docker run -itd --name php -v {your directory}:/var/www/html -p 8080:80 bananabb/php) to bind mount your working directory.
Usage
docker pull bananabb/php:latest
docker run -itd --name php -p 8080:80 bananabb/php
docker exec -it php /bin/bash
nginx -t
php -v
composer -V
Restart Services (If you need)
/etc/init.d/nginx reload
/etc/init.d/php8.3-fpm restart
Create Laravel project
  1. Run command as /laravel.sh in docker container
  2. Enter your project name
  3. Enter your export port (Please sync with docker export port)
  4. The project is located on /var/www/html
Use mailhog for email testing
  1. Create mailhog docker container. (Sample of docker-compose.yml attached, please change your content)
  2. Change the config as below Config Setting
  3. Change your content in sendEmail.php
  4. Run php sendEmail.php
  5. You can check the result on localhost:8025
Config Setting
# Enter to php Container
# Find `sendmail_path` and change as below in file `/etc/php/8.3/cli/php.ini`
sendmail_path="/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025"

License

MIT © BananaBb

Tag summary

Content type

Image

Digest

sha256:d4328e5f4

Size

536.8 MB

Last updated

almost 2 years ago

docker pull bananabb/php