Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

Commit

Permalink
Compose demos: nav+sql and nav+sql+web
Browse files Browse the repository at this point in the history
Compose demos:
- nav+sql
- nav+sql+web (with gMSA).
  • Loading branch information
Koubek committed May 25, 2017
1 parent a304a2e commit d2d6465
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 2 deletions.
3 changes: 3 additions & 0 deletions root/run/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/gMSA/*
*.tmp
!**/README.md*
3 changes: 3 additions & 0 deletions root/run/nav-sql-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dockerfiles for MS Dynamics NAV - root directory
[![Join the chat at https://gitter.im/dockerfiles-dynamics-nav/Lobby](https://badges.gitter.im/dockerfiles-dynamics-nav/Lobby.svg)](https://gitter.im/dockerfiles-dynamics-nav/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

13 changes: 13 additions & 0 deletions root/run/nav-sql-web/_create.gMSA.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[CmdletBinding()]
param (

)

. (Join-Path $PSScriptRoot '_createlinks.ps1')

$content = (Get-Item *.yml | Get-Content)
$hosts = . .\gMSA\scripts\Get-HostnamesFromComposeFiles $content

Write-Verbose "The hosts localised in the docker-compose files: $hosts"

. .\gMSA\scripts\Create-gMSA.ps1 $hosts
3 changes: 3 additions & 0 deletions root/run/nav-sql-web/_createlinks.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if ((Test-Path (Join-Path $PSScriptRoot 'gMSA')) -eq $false) {
New-Item -ItemType Junction -Path (Join-Path $PSScriptRoot 'gMSA') -Value (Join-Path $PSScriptRoot '..\..\__content\gMSA')
}
2 changes: 2 additions & 0 deletions root/run/nav-sql-web/_presetvars.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
. (Join-Path $PSScriptRoot '..\..\_presetvars.sql.ps1')
. (Join-Path $PSScriptRoot '..\..\_presetvars.nav.ps1')
13 changes: 13 additions & 0 deletions root/run/nav-sql-web/_run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[CmdletBinding()]
param (

)

. (Join-Path $PSScriptRoot '_createlinks.ps1')
. (Join-Path $PSScriptRoot '_presetvars.ps1')

docker-compose -f docker-compose.yml -f docker-compose.configs.yml up

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' navsqlweb_sql_1
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' navsqlweb_nav_1
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' navsqlweb_web_1
98 changes: 98 additions & 0 deletions root/run/nav-sql-web/docker-compose.configs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
version: '3.0'
services:
sql:
volumes:
# Volumes to be mapped between the host:container.
# Don`t change the right side if don`t understand it (or change rest of the paths in this documents as well).
- .\..\..\__content_user\SQLDB:C:\SQLDB
environment:
# sa password (this needs to be changed as this is not secure!!!).
# This value must match 'services.nav.environment.sql_pwd' in this file.
sa_password: "Password1"

# Use attach_dbs only when working with a DB that needs to be attached just with the first run =>
# => you have db files and not just the backup.
# attach_dbs: "[{'dbName':'NAVDB','dbFiles':['C:\\\\SQLDB\\\\NAVDB_Data.mdf','C:\\\\SQLDB\\\\NAVDB_Log.ldf']}]"

# USER-TO-DO
# Use restore_dbs when you want to restore a DB backup on the first run. The script will handle it and with
# any following start (container start) will attach an existing DB that was deployed during the first run.
# This means that the data should remain persistent between every single run.
restore_dbs: "[{'dbName':'NAVDB','bckFile':'C:\\\\SQLDB\\\\Demo Database NAV (10-0).bak'}]"

# Folder where the DBs will be restored to (and also recovered when attaching).
# This path must match with the mapped paths ('volumes').
base_db_folder: "C:\\SQLDB\\"

# If true there will be a folder per hostname in 'base_db_folder' (C:\SQLDB\[HOSTNAME]\DATA\).
# If false the DB files will be stored directly in the 'base_db_folder'\DATA (C:\SQLDB\DATA\).
use_hostname_folder: "false"

# Put "Y" to accept EULA.
ACCEPT_EULA: "Y"

security_opt:
- "credentialspec=file://demo_sql.json"

hostname: "demo_sql"

nav:
environment:
# NAV service instance name.
nav_instance: "NAVSERVICE"

# Name of the sql (sql/instance). We are using a reference to service name (sql) defined in 'docker-compose.yml'.
sql_server: "demo_sql"

# USER-TO-DO
# Must match 'services.sql.environment.restore_dbs[any].dbName' or
# 'services.sql.environment.attach_dbs[any].dbName'
sql_db: "NAVDB"

# sa or an existing SQL user (db_owner).
sql_user: "sa"

# Must match 'services.sql.environment.sa_password' or just pwd of 'services.nav.environment.sql_user'.
sql_pwd: "Password1"

# USER-CAN-DO
# NAV user name.
nav_user: "MYNAVUSER"

# USER-CAN-DO
# NAV user password.
nav_user_pwd: "MyNavUserPwd1@"

# RECOMMENDED: true
# Import the license in case of starting a fresh SQL instance (current docker-compose case).
import_cronus_license: "true"

# RECOMMENDED: false
# If false => won`t reconfigure an existing NAV instance.
# When restarting container and this parameter is true, all steps will be repeated and can override
# some manually configured values.
config_instance: "false"

security_opt:
- "credentialspec=file://demo_nav.json"

hostname: "demo_nav"

web:
environment:
# NAV service instance name.
nav_instance: "NAVSERVICE"

# Name of the NAV server. We are using a reference to service name (nav) defined in 'docker-compose.yml'.
nav_server: "demo_nav"

# Client Service port of the NAV instance.
nav_client_port: "7046"

# Name of the NAV Web Instance that will be created.
nav_web_instance: "NAVWEB"

security_opt:
- "credentialspec=file://demo_web.json"

hostname: "demo_web"
36 changes: 36 additions & 0 deletions root/run/nav-sql-web/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3.0'
services:
sql:
image: ${repo}/${sqlImageName}
ports:
- "1433"
networks:
default:
aliases:
- demo_sql
nav:
image: ${repo}/${navImageNameSql}
depends_on:
- "sql"
ports:
- "7045-7049"
networks:
default:
aliases:
- demo_nav
web:
image: ${repo}/${navWebImageName}
depends_on:
- "nav"
expose:
- "80"
- "443"
networks:
default:
aliases:
- demo_web

networks:
default:
external:
name: transparent
2 changes: 0 additions & 2 deletions root/run/nav-sql/docker-compose.configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ services:

# Put "Y" to accept EULA.
ACCEPT_EULA: "Y"
ports:
- "1433:1433" # for debug. Remove this for production

nav:
environment:
Expand Down
2 changes: 2 additions & 0 deletions root/run/nav-sql/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: '3.0'
services:
sql:
image: ${repo}/${sqlImageName}
ports:
- "1433:1433"
networks:
default:
aliases:
Expand Down

0 comments on commit d2d6465

Please sign in to comment.