Skip to content

LAMP Stack based on CentOS 7 - equipped with MariaDB 10.3 and PHP 7.2 from Remi Collet repo

License

Notifications You must be signed in to change notification settings

lmaster1972/centos7-lampstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CentOS 7 Apache, PHP 7.2 Docker image setup

Basic Docker setup to enable a quick start for a LAMP Stack based on CentOS 7 with MariaDB

TODOs

  • Basic setup
  • Expose services
  • MySQL proper volume mount

How to run

docker-compose up -d

Services exposed

Service Port Notes
Apache 80 ---
MySQL 3306 ---
  • Apache to port 80
  • MariaDB to port 3306

Hosts within your environment

You'll need to configure your application to use any services you enabled:

Service Port Notes
www 80 ---
db 3306 ---

Docker compose cheatsheet

  • Start containers in background: docker-compose up -d
  • Start containers on foreground: docker-compose up. You will see a stream of logs for every container running.
  • Stop containers: docker-compose stop
  • Kill containers: docker-compose kill
  • View container logs: docker-compose logs
  • Execute command inside of container: docker-compose exec SERVICE_NAME COMMAND where COMMAND is whatever you want to run. Examples:
    • Shell into the PHP container, docker-compose exec www bash
    • Run symfony console, docker-compose exec www bin/console
    • Open a mysql shell, docker-compose exec db mysql -uroot -pCHOSEN_ROOT_PASSWORD

Recommendations

  • Run composer outside of the php container, as doing so would install all your dependencies owned by root within your vendor folder.
  • Run commands (ie bash's console) straight inside of your container. You can easily open a shell as described above and do your thing from there.
  • Subfolders called 'www', 'mysql' and 'mysql-dump' are need in order to let container work properly.

Credits

PHPDocker Xdebug with Docker and PHPStorm

License

GPL v3

About

LAMP Stack based on CentOS 7 - equipped with MariaDB 10.3 and PHP 7.2 from Remi Collet repo

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published