feat: support self-host docker build (#5506)

Test command: `docker compose -f ./.github/deployment/self-host/compose.yaml up`
This commit is contained in:
LongYinan
2024-01-10 08:35:21 +00:00
parent 0d7ffb0511
commit 237722f7f9
20 changed files with 241 additions and 37 deletions
@@ -91,6 +91,7 @@ export interface AFFiNEConfig {
* @env NODE_ENV
*/
readonly env: string;
/**
* fast AFFiNE environment judge
*/
@@ -49,6 +49,7 @@ const jwtKeyPair = (function () {
})();
export const getDefaultAFFiNEConfig: () => AFFiNEConfig = () => {
let isHttps: boolean | null = null;
const defaultConfig = {
serverId: 'affine-nestjs-server',
version: pkg.version,
@@ -56,6 +57,7 @@ export const getDefaultAFFiNEConfig: () => AFFiNEConfig = () => {
AFFINE_SERVER_PORT: ['port', 'int'],
AFFINE_SERVER_HOST: 'host',
AFFINE_SERVER_SUB_PATH: 'path',
AFFIHE_SERVER_HTTPS: 'https',
AFFINE_ENV: 'affineEnv',
DATABASE_URL: 'db.url',
ENABLE_CAPTCHA: ['auth.captcha.enable', 'boolean'],
@@ -117,7 +119,10 @@ export const getDefaultAFFiNEConfig: () => AFFiNEConfig = () => {
earlyAccessPreview: false,
},
get https() {
return !this.node.dev;
return isHttps ?? !this.node.dev;
},
set https(value: boolean) {
isHttps = value;
},
host: 'localhost',
port: 3010,