Skip to content

just a lightweight lamp stack (linux - apache - mysql - php) with docker

License

Notifications You must be signed in to change notification settings

dannyalfonzo/docker-lamp-stack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-lamp-stack

just a lightweight lamp stack (linux - apache - mysql5.7 - php7.1) with docker

Usage

Make sure that:

  • docker and docker-compose are installed
  • you cloned this repository into your favorite directory
  • no service is currently running on port 80 or 443

Then just start the docker containers using

docker-compose up

Now you can connect to your webserver on http://localhost/ or https://localhost/ (with a non trusted certificate)

To stop the current container use

docker-compose down

Configuration

New vhosts

To enable new vhosts:

  • add a new configuration file like sites-enabled/{{your-new-vhost}}.conf
  • create the directories sites/{{your-new-vhost}}/html and sites/{{your-new-vhost}}/log
  • adding the new domain to your local /etc/hosts file like 127.0.0.1 {{your-new-vhost}} Afterwards just execute:
docker-compose -it lamp_apache_php /etc/init.d/apache2 reload

To see an example just have a look on sites-enabled/test.localhost.conf

Other php version
docker-compose build
  • start your lamp stack with the new php version
docker-compose up
Adding php modules
docker-compose build

/*********** ADDED BY DANNY *******************/

docker-compose ps

Name Command State Ports

lamp_apache docker-php-entrypoint apac ... Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp lamp_db docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp, 33060/tcp

Execute mysql command from the host to container running mysql server
docker exec -t -i lamp_db /bin/bash root@141f63a75843:/#

About

just a lightweight lamp stack (linux - apache - mysql - php) with docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 99.0%
  • PHP 1.0%