Laravel Sail is a lightweight command-line interface for running Laravel applications using Docker as the underlying containerization technology. It provides a simple way to set up a development environment for Laravel applications that includes all the necessary dependencies and services, such as PHP, Nginx, and MySQL. However, until recently, one of the limitations of Laravel Sail was the lack of support for Microsoft SQL Server, which is a popular database management system used by many enterprise applications.
> 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
-
Create the alias to sail.
alias sail='bash vendor/bin/sail'
-
Build the container with:
sail up
-
Publish the Dockerfile:
sail artisan sail:publish
This command create a docker directory in your application's root directory.
-
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:
-
https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver15
-
https://www.microsoft.com/en-us/sql-server/developer-get-started/php/ubuntu/step/2.html
Can you take my Dockerfile configuration in the gist: https://gist.github.com/Sirpyerre/1db05b2ca681ea680646259805aee293
-
-
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
-
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.