Monoforms

Laravel Sail and SQL Server Driver


SQL-Azure-laravel-sail

Note: this Dockerfile don't add SQL Server container. Only add ODB Driver for SQL Server and PHP Driver for SQL Server, I use an azure DB

  1. Create the alias to sail.

    alias sail='bash vendor/bin/sail' 
    
  2. Build the container with:

    sail up
    
  3. Publish the Dockerfile:

    sail artisan sail:publish
    

    This command create a docker directory in your application's root directory.

  4. Customize the Dockerfile: in docker/8.0/ folder open the Dockerfile and add the entries for ODBC Driver for SQL Server and PHP Driver for SQL Server. Check this links:

    Can you take my Dockerfile configuration in the gist: https://gist.github.com/Sirpyerre/1db05b2ca681ea680646259805aee293

  5. Check the context for docker-compose.yml and remove or comment the entries for MySQL:

    build:
        context: ./docker/8.0
        dockerfile: Dockerfile
        args:
            WWWGROUP: '${WWWGROUP}'
    

    Example in: https://gist.github.com/Sirpyerre/b59d7e3c3bd00d9e29adb31cd386730b

  6. Rebuild your application's containers using the build command:

    sail build --no-cache
    

Check the documentation for Laravel Sail: https://laravel.com/docs/8.x/sail#introduction

Thank you for read.


...
Monoforms ©2021 Created by Pedro Rojas Reyes