Skip to main content

Install on Linux Server (Advanced)

Following documents are for the installation of Offision onto the Linux Server.

Prerequisites
  • Linux environment that support Docker, while most of the Linux distributions (such as Redhat, CentOS, Ubuntu, Oracle Linux, etc..) will support Docker.
  • Install Docker Engine based on the Linux OS of your environment, you may follow the official Guideline .
  • Install Docker Compose. You should choose linux Standalone binary on the Linux OS, you may follow the official Guideline.
  • MySQL 8 or above
  • a Valid SSL Certificate

Setup Procedure

info

To confirm if Docker Engine is installed correctly, use command sudo docker images

To confirm if Docker Compose is installed successfully, use command sudo docker-compose version

tip

Making docker auto start when the server restart will make the maintenance easier, use following command (Reference)

sudo systemctl enable docker.service
sudo systemctl enable containerd.service
  1. Put the Offision Server image offision.tar into the folder /offision
caution

Offision Server image do not have direct download link. If you want to have the Offision Server Image for installation, Please contact ONES Software

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

services:
offision:
image: ones-software/offision:latest
restart: always
volumes:
- /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
Architecture__Database: 'Mysql'
ConnectionStrings__MainDatabase: 'Server=DATABASE_SERVER_ADDRESS;Port=3306;Database=Bookings.ONE;Uid=DATABASE_USERNAME;Pwd=DATABASE_PASSWORD;Allow User Variables=true'
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 Mysql are running on the same server as the Docker, you have to set DATABASE_SERVER_ADDRESS as 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 /offision/certificate/, the certificate name must be offision.pfx
  3. Open Terminal, go to folder /offision
  4. Load the latest Offision Server image: run command sudo docker load --input ./offision.tar
  5. Start Offision: run command sudo docker-compose up -d
  6. Now you can access the Offision console by https://localhost

Following is 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'
Architecture__Database: 'Mysql'

ConnectionStrings__MainDatabase: 'Server=host.docker.internal;Port=3306;Database=Bookings.ONE; 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 /offision
  2. Open PowerShell in /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
tip

It is not necessary to put the images in folder /offision, any drives or folders are workable. If you want to move to other folder, replace the '/offision' with your target folder (e.g. /users/machine/offision)