Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docker environment for Laravel

NotificationsYou must be signed in to change notification settings

dmsemenov/laravel-docker-environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Docker environment configuration for Laravel development.Contains settings for local development for new project or already existing.

Repository provides:

  • Laravel ^9.0 || ^10.0
  • PHP 8.2
  • Nginx: stable
  • MySql 8.0
  • Xdebug 3.2.0
  • Redis
  • Node: latest

Note: If you want to use PHP 7git clone --depth 1 --branch php-7.x git@github.com:dmsemenov/laravel-docker-environment.git

Installation

Note: Local environment tested on Ubuntu and macOS. Feel free to create an Issue for other OS.

  1. Clone repository

    mkdir {YOUR_NEW_FOLDER}cd {YOUR_NEW_FOLDER}git clone git@github.com:dmsemenov/laravel-docker-environment.git .
  2. Configure main.env file

    cp .env.example .env

    SetPROJECT_NAME variable.
    SetPROJECT_FOLDER variable for example 'backend' or whatever you want. By default it ismain.

  3. Configure maindocker-compose.yml file

    # Local developmentcp docker-compose.yml.example docker-compose.yml

    Set variables for mysql container. Docker will create database and user at first UP.

    MYSQL_ROOT_PASSWORD:  MYSQL_DATABASE: ${PROJECT_NAME}  MYSQL_USER: ${PROJECT_NAME}  MYSQL_PASSWORD:
  4. Install Application
    Install or copy your existing application toPROJECT_FOLDER.

    # Run containersdocker-compose up -d --build# Install newdocker-compose exec php-fpm composer create-project --prefer-dist laravel/laravel .
  5. Configure Application.env

    Set variables fromstep 3

    DB_HOST=mysql  DB_DATABASE=  DB_USERNAME=  DB_PASSWORD=
  6. Run Application

    # Run containersdocker-compose up -d# Base UI. If needed!docker-compose exec -uwww-data php-fpm composer require laravel/ui --devdocker-compose exec -uwww-data php-fpm php artisan ui bootstrap --auth# Build frontenddocker-compose run --rm --no-deps -unode node bash -ci 'npm i&&npm run dev'# Migratedocker-compose exec -uwww-data php-fpm php artisan migratedocker-compose exec -uwww-data php-fpm composer install
  7. Launchhttp://localhost:8989/register


[8]ページ先頭

©2009-2025 Movatter.jp