GithubHelp home page GithubHelp logo

setup-laravel-with-docker's Introduction

Setup Laravel with Docker

Step 1 (Option). Setup .env

  • Open file .env change PROJECT_NAME to set project name (default laravel_example) and change version laravel LARAVEL_VERSION.
  • When we run docker-compose, it automatic create project namelaravel_example in folder ./www/
  • Note: Project already installed dependencies (composer, generate encryption key, npm)
PROJECT_NAME=laravel_example
LARAVEL_VERSION=7.*

Step 2 (Required). Start Docker

  • Run docker-compose up -d command to build container.
docker-compose up -d
  • If you want to execute migrate, npm, restart composer,...
docker exec -it app /bin/bash
cd html/your_project_name
composer install
npm install
npm run watch/dev/prod

Step 3 (Required). Create virtualhost in project

  • Note: Please stay your path in repo here. Ex: /home/{name}/your_repo
  • Run command
sudo ./scripts/create-virtualhost.sh {your_domain} {your_project_in_path_www}
  • Ex: I created project name laravel and my domain laravel.local. After ran docker-compose laravel was created in path ./www/laravel
  • Then I run sudo ./scripts/create-virtualhost.sh laravel.local laravel
  • Check the service online at http://laravel.local/ Screenshot from 2022-03-20 12-54-18

PHPMYADMIN

Contact

setup-laravel-with-docker's People

Contributors

hoangvan149dhv avatar vandh-2842 avatar

Stargazers

 avatar

Watchers

 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.