安裝在Windows伺服器上
以下文件是用於在Windows伺服器上安裝Bookings ONE。
先決條件
設置程序
- 將 Bookings ONE 伺服器圖像
bookings-one.tar
放入文件夾c:\bookings-one
- 將以下腳本保存到
c:\bookings-one\docker-compose.yml
version: '3.1'
services:
bookings-one:
image: ones-software/bookings-one:latest
restart: always
volumes:
- /c/bookings-one:/etc/bookings-one
environment:
BackgroundJob__TimeZone: 'Asia/Hong_Kong'
File__BaseDirectory: '/etc/bookings-one/upload-files'
Logging__ErrorLog__FileLogDirectory: '/etc/bookings-one/error-logs/error-logs-{Date}.txt'
Logging__InfoLog__FileLogDirectory: '/etc/bookings-one/info-logs/info-logs-{Date}.txt'
Logging__DbLog__FileLogDirectory: '/etc/bookings-one/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/bookings-one/certificate/bookings-one.pfx'
ports:
- 443:443
.yml 文件的間距非常重要,請保持與示例相同的縮進
- 修改
docker-compose.yml
:- 將
DATABASE_SERVER_ADDRESS
,DATABASE_USERNAME
和DATABASE_PASSWORD
替換為您的數據庫連接字符串如果您的 SQLExpress 與 Docker 在同一台伺服器上運行,則必須啟用SQLExpress remote connect 遠程連接並且 DATABASE_SERVER_ADDRESS
使用host.docker.internal,1433
- 將
WEB_PUSH_PRIVATE_KEY
和WEB_PUSH_PUBLIC_KEY
替換為您的密鑰對。此密鑰為 VAPID 密鑰,您可以自己生成或使用某些在線密鑰生成器生成 - 將
CERTIFICATE_PASSWORD
替換為您的證書密碼
- 將
- 把證書文件放到
C:\bookings-one\certificate\
,證書名必須是bookings-one.pfx
- 打開 PowerShell,轉到
C:\bookings-one
- 運行命令
docker load --input ./bookings-one.tar
- 運行命令
docker-compose up -d
- 現在您可以通過
https://localhost
訪問 Bookings ONE 控制台
以下是一個示例 docker-compose.yml
供您參考
version: '3.1'
services:
bookings-one:
image: ones-software/bookings-one:latest
restart: always
volumes:
- /c/bookings-one:/etc/bookings-one
environment:
BackgroundJob__TimeZone: 'Asia/Hong_Kong'
File__BaseDirectory: '/etc/bookings-one/upload-files'
Logging__ErrorLog__FileLogDirectory: '/etc/bookings-one/error-logs/error-logs-{Date}.txt'
Logging__InfoLog__FileLogDirectory: '/etc/bookings-one/info-logs/info-logs-{Date}.txt'
Logging__DbLog__FileLogDirectory: '/etc/bookings-one/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/bookings-one/certificate/bookings-one.pfx'
ports:
- 443:443
更新 Bookings ONE 伺服器
- 將最新的 Bookings ONE 伺服器映像下載到
C:\bookings-one
- 在
C:\bookings-one
中打開 PowerShell - 停止 Bookings ONE ,運行命令
docker-compose down
- 加載最新的 Bookings ONE 伺服器鏡像,運行命令
docker load --input ./bookings-one.tar
- 更新並啟動 Bookings ONE,運行命令
docker-compose up
C:\bookings-one
中,任何驅動器或文件夾都可以使用,如果要移動到其他文件夾,請將“/c/bookings-one”替換為目標文件夾(例如 /d/server/bookings-one)