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

Commit d2d6465

Browse files
committed
Compose demos: nav+sql and nav+sql+web
Compose demos: - nav+sql - nav+sql+web (with gMSA).
1 parent a304a2e commit d2d6465

File tree

10 files changed

+173
-2
lines changed

10 files changed

+173
-2
lines changed

root/run/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/gMSA/*
2+
*.tmp
3+
!**/README.md*

root/run/nav-sql-web/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Dockerfiles for MS Dynamics NAV - root directory
2+
[![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)
3+

root/run/nav-sql-web/_create.gMSA.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[CmdletBinding()]
2+
param (
3+
4+
)
5+
6+
. (Join-Path $PSScriptRoot '_createlinks.ps1')
7+
8+
$content = (Get-Item *.yml | Get-Content)
9+
$hosts = . .\gMSA\scripts\Get-HostnamesFromComposeFiles $content
10+
11+
Write-Verbose "The hosts localised in the docker-compose files: $hosts"
12+
13+
. .\gMSA\scripts\Create-gMSA.ps1 $hosts

root/run/nav-sql-web/_createlinks.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if ((Test-Path (Join-Path $PSScriptRoot 'gMSA')) -eq $false) {
2+
New-Item -ItemType Junction -Path (Join-Path $PSScriptRoot 'gMSA') -Value (Join-Path $PSScriptRoot '..\..\__content\gMSA')
3+
}

root/run/nav-sql-web/_presetvars.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
. (Join-Path $PSScriptRoot '..\..\_presetvars.sql.ps1')
2+
. (Join-Path $PSScriptRoot '..\..\_presetvars.nav.ps1')

root/run/nav-sql-web/_run.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[CmdletBinding()]
2+
param (
3+
4+
)
5+
6+
. (Join-Path $PSScriptRoot '_createlinks.ps1')
7+
. (Join-Path $PSScriptRoot '_presetvars.ps1')
8+
9+
docker-compose -f docker-compose.yml -f docker-compose.configs.yml up
10+
11+
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' navsqlweb_sql_1
12+
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' navsqlweb_nav_1
13+
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' navsqlweb_web_1
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
version: '3.0'
2+
services:
3+
sql:
4+
volumes:
5+
# Volumes to be mapped between the host:container.
6+
# Don`t change the right side if don`t understand it (or change rest of the paths in this documents as well).
7+
- .\..\..\__content_user\SQLDB:C:\SQLDB
8+
environment:
9+
# sa password (this needs to be changed as this is not secure!!!).
10+
# This value must match 'services.nav.environment.sql_pwd' in this file.
11+
sa_password: "Password1"
12+
13+
# Use attach_dbs only when working with a DB that needs to be attached just with the first run =>
14+
# => you have db files and not just the backup.
15+
# attach_dbs: "[{'dbName':'NAVDB','dbFiles':['C:\\\\SQLDB\\\\NAVDB_Data.mdf','C:\\\\SQLDB\\\\NAVDB_Log.ldf']}]"
16+
17+
# USER-TO-DO
18+
# Use restore_dbs when you want to restore a DB backup on the first run. The script will handle it and with
19+
# any following start (container start) will attach an existing DB that was deployed during the first run.
20+
# This means that the data should remain persistent between every single run.
21+
restore_dbs: "[{'dbName':'NAVDB','bckFile':'C:\\\\SQLDB\\\\Demo Database NAV (10-0).bak'}]"
22+
23+
# Folder where the DBs will be restored to (and also recovered when attaching).
24+
# This path must match with the mapped paths ('volumes').
25+
base_db_folder: "C:\\SQLDB\\"
26+
27+
# If true there will be a folder per hostname in 'base_db_folder' (C:\SQLDB\[HOSTNAME]\DATA\).
28+
# If false the DB files will be stored directly in the 'base_db_folder'\DATA (C:\SQLDB\DATA\).
29+
use_hostname_folder: "false"
30+
31+
# Put "Y" to accept EULA.
32+
ACCEPT_EULA: "Y"
33+
34+
security_opt:
35+
- "credentialspec=file://demo_sql.json"
36+
37+
hostname: "demo_sql"
38+
39+
nav:
40+
environment:
41+
# NAV service instance name.
42+
nav_instance: "NAVSERVICE"
43+
44+
# Name of the sql (sql/instance). We are using a reference to service name (sql) defined in 'docker-compose.yml'.
45+
sql_server: "demo_sql"
46+
47+
# USER-TO-DO
48+
# Must match 'services.sql.environment.restore_dbs[any].dbName' or
49+
# 'services.sql.environment.attach_dbs[any].dbName'
50+
sql_db: "NAVDB"
51+
52+
# sa or an existing SQL user (db_owner).
53+
sql_user: "sa"
54+
55+
# Must match 'services.sql.environment.sa_password' or just pwd of 'services.nav.environment.sql_user'.
56+
sql_pwd: "Password1"
57+
58+
# USER-CAN-DO
59+
# NAV user name.
60+
nav_user: "MYNAVUSER"
61+
62+
# USER-CAN-DO
63+
# NAV user password.
64+
nav_user_pwd: "MyNavUserPwd1@"
65+
66+
# RECOMMENDED: true
67+
# Import the license in case of starting a fresh SQL instance (current docker-compose case).
68+
import_cronus_license: "true"
69+
70+
# RECOMMENDED: false
71+
# If false => won`t reconfigure an existing NAV instance.
72+
# When restarting container and this parameter is true, all steps will be repeated and can override
73+
# some manually configured values.
74+
config_instance: "false"
75+
76+
security_opt:
77+
- "credentialspec=file://demo_nav.json"
78+
79+
hostname: "demo_nav"
80+
81+
web:
82+
environment:
83+
# NAV service instance name.
84+
nav_instance: "NAVSERVICE"
85+
86+
# Name of the NAV server. We are using a reference to service name (nav) defined in 'docker-compose.yml'.
87+
nav_server: "demo_nav"
88+
89+
# Client Service port of the NAV instance.
90+
nav_client_port: "7046"
91+
92+
# Name of the NAV Web Instance that will be created.
93+
nav_web_instance: "NAVWEB"
94+
95+
security_opt:
96+
- "credentialspec=file://demo_web.json"
97+
98+
hostname: "demo_web"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: '3.0'
2+
services:
3+
sql:
4+
image: ${repo}/${sqlImageName}
5+
ports:
6+
- "1433"
7+
networks:
8+
default:
9+
aliases:
10+
- demo_sql
11+
nav:
12+
image: ${repo}/${navImageNameSql}
13+
depends_on:
14+
- "sql"
15+
ports:
16+
- "7045-7049"
17+
networks:
18+
default:
19+
aliases:
20+
- demo_nav
21+
web:
22+
image: ${repo}/${navWebImageName}
23+
depends_on:
24+
- "nav"
25+
expose:
26+
- "80"
27+
- "443"
28+
networks:
29+
default:
30+
aliases:
31+
- demo_web
32+
33+
networks:
34+
default:
35+
external:
36+
name: transparent

root/run/nav-sql/docker-compose.configs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ services:
3030

3131
# Put "Y" to accept EULA.
3232
ACCEPT_EULA: "Y"
33-
ports:
34-
- "1433:1433" # for debug. Remove this for production
3533

3634
nav:
3735
environment:

root/run/nav-sql/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: '3.0'
22
services:
33
sql:
44
image: ${repo}/${sqlImageName}
5+
ports:
6+
- "1433:1433"
57
networks:
68
default:
79
aliases:

0 commit comments

Comments
 (0)