Git Product home page Git Product logo

laravel-devcontainer's Introduction

Laravel Development Containers for Visual Studio Code

laravel-devcontainer is a simple configuration to support fully-dockerised development of Laravel applications using Visual Studio Code. Unlike Laravel Sail, laravel-devcontainer has been built so that the entire development experience is dockerised. The only requirements are:

Visual Studio Code will actually run inside a Docker container with php-cli as well as other development tools. Any Extensions will also run in the same container, meaning that intellisense will use the same php-cli configuration!

laravel-devcontainer currently ships with:

  • php:8.3-cli-alpine workspace with composer, pgsql, redis, and nodejs.
  • php:8.3-fpm-alpine container with pgsql and redis extensions.
  • nginx:1.27-alpine preconfigured for your Laravel application.
  • postgres:16.3-alpine preconfigured with the default Laravel credentials.
  • redis:7.2-alpine for caching, queues, sessions, etc.

Easy Installation

Using this configuration is quite simple. Download and place laravel-devcontainer in a .devcontainer folder with your Laravel Code. If starting a new project, you may create a new folder with just laravel-devcontainer in your .devcontainer folder. You may then install Laravel using Composer (e.g. under example-app). You may then move the .devcontainer folder to your code folder (mv .devcontainer example-app) and use that!

Installing Using Git Submodules

Alternatively, you may use Git Submodules. Install the configuration by running

git submodule add https://github.com/theomessin/laravel-devcontainer .devcontainer

If you use this method, do not forget to install submodules when cloning:

git clone --recurse-submodules ...

Usage

Start Visual Studio Code (e.g. code example-app) and re-open in remote containers (Remote-Containers: Reopen in Container). This may take some time on the first use, as Docker initially downloads and builds the images. Eventually, Visual Studio Code will run inside the workspace container. Extensions and settings specified in devcontainer.json will be auto-configured!

Be sure to correctly configure your application .env to use the devcontainer postgres and redis. For example:

DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

You may then navigate to localhost on your local machine. Fingers crossed, you will see your Laravel application! Run any artisan or composer commands using the Visual Studio Code Integrated Terminal. As such, you do not need anything else installed on your host machine!

Extensions

laravel-devcontainer currently ships with the following extensions for Laravel development in Visual Studio Code:

laravel-devcontainer's People

Contributors

leandroguimaraes avatar theomessin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-devcontainer's Issues

Add pgAdmin

Add pgAdmin (pgadmin.org) for easy database access.

[question] connect to RDS instead local mysql?

Hello there, first, thank you so much for this repo,
it's amazing the way that works!

I wonder to know if it's possible to connect to the Amazon RDS database?
I'm trying to put the credentials to .env, but I got denied msg and the IP showing on error was not from my RDS address

Next Steps

Hi,
may I ask You what to do next ?

I have Docker installed.
I have Remote Containers installed on VStudioCode

Could You please integrate Your README file with some info about installing Laravel ?

Tks
FabioG

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.