Skip to main content

Install on Windows Server

Following documents are for the installation of Offision onto the Windows server.

Prerequisites
  • Windows server, support one of the following releases:
    - Windows server 2022
    - Windows server 2019
    - Windows server 2016 (version 1709 or 1803)
  • Database SQL Server 2016 or above, with Full-text search enabled
  • You may also use SQLExpress for the non-production usage, and please note that there are performance limitation for the SQL Express
  • a Valid SSL Certificate

Setup Procedure

  1. Put the Offision Server image offision.tar into the folder c:\offision
caution

Offision Server image have no direct download link. If you do not have Offision Server Image, Please contact ONES Software

  1. Save the following script into c:\offision\docker-compose.yml
version: '3.1'

services:
offision:
image: ones-software/offision:latest
restart: always
volumes:
- /c/offision:/etc/offision
environment:
BackgroundJob__TimeZone: 'Asia/Hong_Kong'
File__BaseDirectory: '/etc/offision/upload-files'
Logging__ErrorLog__FileLogDirectory: '/etc/offision/error-logs/error-logs-{Date}.txt'
Logging__InfoLog__FileLogDirectory: '/etc/offision/info-logs/info-logs-{Date}.txt'
Logging__DbLog__FileLogDirectory: '/etc/offision/db-logs/db-logs-{Date}.txt'
WebPush__PrivateKey: WEB_PUSH_PRIVATE_KEY
WebPush__PublicKey: WEB_PUSH_PUBLIC_KEY
ConnectionStrings__MainDatabase: 'Server=DATABASE_SERVER_ADDRESS;Database=Bookings.ONE;User=DATABASE_USERNAME;Password=DATABASE_PASSWORD;'
ASPNETCORE_URLS: 'https://+;http://+'
ASPNETCORE_HTTPS_PORT: 443
ASPNETCORE_Kestrel__Certificates__Default__Password: CERTIFICATE_PASSWORD
ASPNETCORE_Kestrel__Certificates__Default__Path: '/etc/offision/certificate/offision.pfx'

ports:
- 443:443
Spacing are very important for .yml file, please keep the same indention as the sample
  1. Modify the docker-compose.yml:
    1. Replace the DATABASE_SERVER_ADDRESS, DATABASE_USERNAME and DATABASE_PASSWORD to your Database connection string
      If your SQLExpress are running on the same server as the Docker, you have to enable SQLExpress remote connect and the DATABASE_SERVER_ADDRESS use host.docker.internal,1433
    2. Replace the WEB_PUSH_PRIVATE_KEY and WEB_PUSH_PUBLIC_KEY to your key pair. This key are VAPID key, your may generate by yourselves or using some online key generators
    3. Replace the CERTIFICATE_PASSWORD to your certificate password
  2. Put the certificate file to C:\offision\certificate\, the certificate name must be offision.pfx
  3. Open PowerShell, go to the C:\offision
  4. Run command docker load --input ./offision.tar
  5. Run command docker-compose up -d
  6. Now you can access the Offision console by https://localhost

Following are a sample docker-compose.yml for your reference

version: '3.1'

services:
offision:
image: ones-software/offision:latest
restart: always
volumes:
- /c/offision:/etc/offision
environment:
BackgroundJob__TimeZone: 'Asia/Hong_Kong'
File__BaseDirectory: '/etc/offision/upload-files'
Logging__ErrorLog__FileLogDirectory: '/etc/offision/error-logs/error-logs-{Date}.txt'
Logging__InfoLog__FileLogDirectory: '/etc/offision/info-logs/info-logs-{Date}.txt'
Logging__DbLog__FileLogDirectory: '/etc/offision/db-logs/db-logs-{Date}.txt'
WebPush__PublicKey: 'BJszfqip7Ii_lKSXCd_ZZJXT5FeQwJCZx79mLpr3nY8_rvRzSBLuaTx5dOp4rQZtzI511UvoyRXIwPoZ4_PALFA'
WebPush__PrivateKey: 'C-RkwJZGooRiI0CGNwAmShlaSWsh4SRNkol-ni5LGAk'
ConnectionStrings__MainDatabase: 'Server=host.docker.internal,1433;Database=Bookings.ONE;User=sa;Password=P@$$w0rd'
ASPNETCORE_URLS: 'https://+;http://+'
ASPNETCORE_HTTPS_PORT: 443
ASPNETCORE_Kestrel__Certificates__Default__Password: Password1234
ASPNETCORE_Kestrel__Certificates__Default__Path: '/etc/offision/certificate/offision.pfx'
ports:
- 443:443

Update Offision Server

  1. Download the latest Offision Server image into C:\offision
  2. Open PowerShell in C:\offision
  3. Stop Offision, run command docker-compose down
  4. Load the latest Offision Server image, run command docker load --input ./offision.tar
  5. Update and start Offision, run command docker-compose up -d

How to renew the SSL certificate if it is going to expire?

Go to the original certificate location, replace the existing pfx file with new .pfx file. Default path is c:\offision\certificate\offision.pfx.

If the password of pfx changed the existing docker-compose.yml file, change the field ASPNETCORE_Kestrel__Certificates__Default__Password to new password.

Open powershell and run the following command:

cd c:\offision
docker-compose down
docker-compose up -d

How to handle when database password changed?

Open the existing docker-compose.yml file, change the existing password to new password. Open powershell and run the following command:

cd c:\offision
docker-compose down
docker-compose up -d
tip

It is not necessary to put the images in folder C:\offision, putting into any drives or folders are also workable. If you want to move to other folder, replace the '/c/offision' with your target folder (e.g. /d/server/offision)