This Docker container implements a last generation LAMP stack with a set of popular PHP modules. Includes support for Composer, Bower and npm package managers and a Postfix service to allow sending emails through PHP mail() function.
If you dont need support for MySQL/MariaDB, or your app runs on PHP 5.4, maybe davask/lap suits your needs better.
Includes the following components:
- Debian 10 LTS Buster base image.
- Apache HTTP Server 2.4
- MariaDB 10.0
- Postfix 2.11
- PHP 8
- PHP modules
- php
- php-cgi
- php-cli
- php-common
- php-curl
- php-dev
- php-fpm
- php-gd
- php-imagick
- php-mbstring
- php-mysql
- php-opcache
- php-readline
- php-ssh2
- php-xml
- php-zip
- php-intl
- php-mcrypt
- php-yaml
- php-imap
- Development tools
- cron
- curl
- expect
- dos2unix
- ftp
- nano
- sed
- tree
- unzip
- vim
- wget
- zip
- git
- composer
- npm / nodejs (todo)
- bower (todo)
Installation from Docker registry hub.
You can download the image using the following command:
docker pull davask/local-lamp
This image uses environment variables to allow the configuration of some parameteres at run time:
- Variable name:
- Default value:
- Accepted values:
- Description:
The image exposes ports 22
, 80
, 443
and 3306
, and exports four volumes:
/dwl/home/host
, containing the user host files/var/lib/mysql
, where MariaDB data files are stored./etc/apache2/sites-available
, where Apache sites availables files are stored./etc/apache2/ssl
, where Apache ssl files are stored./etc/letsencrypt
, where Let's Encrypt files are stored.
Please, refer to https://docs.docker.com/storage/volumes for more information on using host volumes.
The user and group owner id for the DocumentRoot directory /dwl/home/host
are both 33 (uid=33(www-data) gid=33(www-data) groups=33(www-data)
).
The user and group owner id for the MariaDB directory /var/log/mysql
are 105 and 108 repectively (uid=105(mysql) gid=108(mysql) groups=108(mysql)
).
docker run -i -t --rm davask/local-lamp bash
docker run --rm -p 8080:80 -v ./volumes/home/host:/dwl/home/host davask/local-lamp
Create a container linking to another MySQL container:
docker run -d --link my-mysql-container:mysql -p 8080:80 -v ./volumes/home/host:/dwl/home/host --name my-lamp-container davask/local-lamp
docker exec -i -t my-lamp-container bash
mysql -u root
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dwlhost
docker-compose up -d
docker-compose down
docker exec -ti <nom de l instance> bash
ping host.docker.internal
add ip to docker /etc/hosts