Giter Club home page Giter Club logo

laravel-php8.1's Introduction

Project Structure

The following is a structure I’ve been using for my Laravel + Docker projects.
├── docker-compose.yml
├── docker-config
│   ├── fpm-pool.conf
│   ├── nginx.conf
│   ├── php.ini
│   └── supervisord.conf
├── Dockerfile
├── laravel
└── README.md

Requirements

  • docker
  • docker-compose
Before we get started, make sure you have Docker and Docker-Compose installed.
I have done all the work for you, just clone this repository and follow the steps mentioned below:

Usage

git clone  https://github.com/NyiNyiSoePaing/laravel-php8.1.git

# Add your entire project files to the "laravel" folder,
cp -r {PROJECT_FILES} laravel

# Edit env file for laravel 
vi laravel/.env

DB_DATABASE=demo

DB_USERNAME=demo

DB_PASSWORD=demo

DB_HOST=database

  • Note - DB_HOST is database service name from docker-compose.yml

Build and Run docker containers

bash run.sh

( or ) Manual Build and Run docker containers

docker-compose up -d ( or ) docker-compose up --build --force-recreate -d #(recreate container)
docker exec -it laravel-app php artisan key:generate # Generate Application Key
docker exec -it laravel-app composer install # install composer
docker exec -it laravel-app chown -R www-data:www-data storage

Containers created and their ports are as follows:

laravel-app - 'http://ip:80'

phpmyadmin - 'http://ip:8888'

Others useful commmands

# Show running container
docker-compose ps ( or ) docker ps

# For shell login to container
docker exec -it container-name ash # Example -( docker exec -it laravel-app ash )

# To stop docker
docker-compose stop/start
docker-compose down #(delete all runningcontainers,network & volumes)

Feedback is appreciated.! If you have any questions,don’t hesitate to reach out to me

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.