Laravel Sail and SQL Server Driver


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:

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

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

    Example in:

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

    sail build --no-cache

Check the documentation for Laravel Sail:

Thank you for read.

Monoforms ©2021 Created by Pedro Rojas Reyes