## Prerequisite
- windows version must be 1809.
- enable hyper-v and container on windows features 
- install docker for desktop on windows 
- go to icon tray on windows and right click on docker icon, then click on option 'switch to windows containers...' 
  * switching from linux to windows will restart docker, please wait until docker start again and then goto next step
- go to icon tray on windows and right click on docker icon, then click on 'settings'
- on the settings window, open the 'Daemon' tab and turn on 'advanced' option
- copy following setting into the configuration section and click on apply button on Daemon tab: 

```
{
  "registry-mirrors": [],
  "insecure-registries": [
    "repo.marcopacs.com"
  ],
  "debug": true,
  "experimental": false
}
```
 * changing docker Daemon settings will restart docker, please wait until docker start again and then goto next step


## Installation Guide

-  create a folder in the production server for example in the drive D(for example: D:/build)
  * it is better to do not choose drive c 

- navigate to created folder in previous step and create a file called docker-compose.yml (for example: D:/build/docker-compose.yml)

- open docker-compose.yml with an editor and paste following statements in the created docker compose file

```
version: "3"

services:
  app:
    container_name: karname-app
    restart: always
    image: repo.marcopacs.com/karname/karname-app
    ports:
      - "80:3000"
    environment:
      ROOT_URL: ${APP_ROOT_URL:-http://localhost}
      MONGO_URL: mongodb://mongo-windows:27017/karname
      PORT: 3000
      METEOR_SETTINGS: '{"worklistUrl":"http://karname-broker","databusUrl":"http://databus"}'

networks:
  default:
    external:
      name: nat
```

- navigate to Drive D and create a folder called "data"
* it is better to do not choose drive c 

- navigate to D:/data and create a folder called "db"

- if you choose drive other than drive D please edit above yaml file ***volumes*** section under ***mongo*** service:
  for example if you choose drive E for creating folder "db" at previous step, change 
  ```
  volumes:
      - D:\data\db:C:\data\db
  ```
  into 
  ```
  volumes:
      - E:\data\db:C:\data\db
  ```
- open CMD

- CD to created folder in step 1 (ex: cd D:/build)

- login into repo.marcopacs.com with following command, in the following command, use your username and password that can login into repo.marcopacs.com:

    docker login -u username -p password repo.marcopacs.com


- run following command: 

    docker-compose up -d --force-recreate

- goto localhost