Giter Site home page Giter Site logo

heartshare / docker-laravel-8 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supermavster/docker-laravel-8

0.0 1.0 0.0 48 KB

A simple Docker - Laravel 8 - MySQL - Redis - PHPAdmin - NGINX - PHP 7.4 - Composer - Artisan - XDebug

Shell 32.49% Dockerfile 67.51%

docker-laravel-8's Introduction

Docker - Laravel

Docker

Image

A pretty simplified Docker Compose workflow that sets up a LEMP (Linux, NGINX, MySQL, PHP) network of containers for local Laravel development.

Ports

Ports used in the project:

Software Port
nginx 8080
phpmyadmin 8081
mysql 3306
php 9000
xdebug 9001
redis 6379

Use

To get started, make sure you have Docker installed on your system and Docker Compose, and then clone this repository.

  1. Clone this project:

    git clone https://github.com/supermavster/docker-laravel-8.git
  2. Inside the folder docker-laravel-8 and Generate your own .env to docker compose with the next command:

    cp .env.example .env
  3. You need Create or Put your laravel project in the folder source; to create follow the next instructions Here.

  4. Build the project whit the next commands:

    docker-compose up --build

Remember

The configuration of the database must be the same on both sides .

# .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD=db_password
DB_ROOT_PASSWORD=secret
# source/.env
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD=db_password

The only change is the DB_HOST in the source/.env where is called to the container of mysql:

# source/.env
DB_HOST=mysql

Special Cases

To Down and remove the volumes we use the next command:

docker-compose down -v

Update Composer:

docker-compose run --rm composer update

Run compiler (Webpack.mix.js) or Show the view compiler in node:

docker-compose run --rm npm run dev

Run all migrations:

docker-compose run --rm artisan migrate

docker-laravel-8's People

Contributors

supermavster avatar

Watchers

James Cloos avatar

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.