Giter Site home page Giter Site logo

sp0ne / docker-lamp Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 52 KB

Personal basic LAMP stack environment built using Docker Compose.

License: MIT License

Dockerfile 42.77% Shell 35.38% Makefile 3.75% PHP 18.09%
docker-composer php stack portainer phpmyadmin vhosts-files

docker-lamp's Introduction

🐳 Docker-lamp · Latest Github release

Basic LAMP stack environment built using Docker Compose.

🚨 Important : This Stack is build for PERSONAL LOCAL development and NOT FOR PRODUCTION USAGE


πŸ“Œ Table of Content


πŸ’» Requirement

Assume you have / Tested on :

  • Ubuntu 20.04 LTS
  • Docker version 19.03.13
  • Docker Compose version 3 (see compatibility)
  • β˜• / 🍡

πŸ—ƒ Introduction

Include in the Docker Compose (tested on Ubuntu 20.04 LTS):

  • PHP Apache (Include: 5.6, 7.1, 7.4)
  • Portainer
  • PhpMyAdmin
  • Database (Include: mariadb 10.3, mysql 5.7, mysql8)
  • Node (Include: 10.16, 12.4)

πŸ’Ύ Installation / Quick start

  1. Clone this repository on your local computer
  2. Init, configure .env as needed: make env
  3. Add yours entry points in ./config/vhosts.txt file (see "Entry Point" below)
  4. Run generation of vhosts files : make generate-vhosts
  5. Add your entry point into /etc/hosts file (see "Entry Point" below)
  6. Run Docker composer:
    • make run-build for build and start
    • Or make run for start only

Your LAMP stack is now ready!! You can access it via localhost.

Now you can access to your environnement:


πŸ’« Configuration and Usage

Configuration

This package comes with default configuration options. You can modify them by creating (Step 2.) .env file in your root directory.

Entry Point

  1. Add yours vhosts URL and ENTRYPOINT Folder in ./config/vhosts.txt:
  2. Run generation of vhosts files : make generate-vhosts and Copy generate host line
  3. Paste your entry point in /etc/hosts after localhost:
# 1
➜ nano /config/vhosts.txt
# Add your URL and PATH with delimiter: `|` 
my-project.localhost|\/var\/www\/my-project\/web

# 2
➜ make generate-vhosts
...
Modify your /etc/host file with these lines:
127.0.0.1 my-project.localhost
...

# 3
➜ sudo nano /etc/hosts
127.0.0.1 localhost # Paste your host line after this line
127.0.0.1 my-project.localhost

PHP INI

PHP_INI: In each PHP Bin you can define your custom php.ini /docker/{PHP_VERSION}/php.ini to meet your requirements.

CMD Shortcut

Available script

  • make or make help for helping
  • make env for init env file
  • make run for start
  • make run-build for build and start
  • make run-php for access into your container php
  • make generate-vhosts for create vhosts files conf
  • make check-vhosts for check if url is available

For windows user check the makefile for cmd.

Docker Shortcut:

  • docker ps List all containers
  • docker ps -aq List all containers (only IDs)
  • docker stop $(docker ps -aq) Stop all running containers

Show Docker log into your server:

➜ docker logs --tail 50 --follow --timestamps [docker-container-name]
# Example
➜ docker logs --tail 50 --follow --timestamps my-container-name

Change [docker-container-name] by your container name


🍭 CREDITS & SUPPORT

If this project help you, feel free to give me a cup of coffee :)

And dont forget: KISS, DRY & CLEAN CODE


SpΓ©cial thanks to @Medzoner and @floyoops !


🍻 Have Fun ! Made with ❀ by @Sp0ne - Lead Developer - vinces.io


docker-lamp's People

Contributors

sp0ne avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

justinlavelle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.