Giter Club home page Giter Club logo

docker-mssql-laravel's Introduction

Docker-Mssql-Laravel

Install

Docker

software containerization platform

Install https://download.docker.com/win/stable/InstallDocker.msi

Kitematic

an installer to quickly and easily install and setup a Docker environment

Install https://github.com/docker/toolbox/releases/tag/v1.12.5

Bash for windows 10 (Not recommend)

This is an option. See http://www.windowscentral.com/how-install-bash-shell-command-line-windows-10

Cmder (Recommend instead of bash for windows)

Download cmder included git. See http://cmder.net/

Run Docker

Mac user should comment out mssql volumes

vi docker/docker-compose.yml

...
mssql:
    build:
        context: mssql
    ports:
        - "11433:1433"
#    volumes:
#        - ./mssql/data:/var/opt/mssql/data
cd docker
docker-compose up -d

Init Database

Connect local MSSQL Server and create database using mssql clients.

Administrator Account

  • ID: sa
  • Password: Password1234

Sample Init

CREATE DATABASE testdb;
USE testuser;
CREATE LOGIN testuser WITH PASSWORD = 'TestUser1234';
CREATE USER testuser FOR LOGIN testdb;
ALTER SERVER ROLE sysadmin ADD MEMBER [testuser];

Laravel

Host

Clone Repository

git clone https://github.com/harryoh/docker-mssql-laravel.git

Connect to docker

cd docker-mssql-laravel/docker
docker exec -it docker_php_1 /bin/bash

Container

Configure environment for Laravel

copy example env file to .env

cd www
cp .env.example .env
vi .env

change database configuration

...
DB_CONNECTION=sqlsrv
DB_HOST=mssql
DB_PORT=11433
DB_DATABASE=testdb
DB_USERNAME=testuser
DB_PASSWORD=TestUser1234
...

Generate Key

php artisan key:generate

Install third party libraries

$ composer install

Database Migration

$ php artisan migrate

Browser

(docker-compose should be running.)

Open 'http://localhost:8080'

docker-mssql-laravel's People

Watchers

 avatar

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.