diff --git a/packages/cli/assets/docker-compose.yml b/packages/cli/assets/docker-compose.yml index 9ec0e9c7..2a5c7518 100644 --- a/packages/cli/assets/docker-compose.yml +++ b/packages/cli/assets/docker-compose.yml @@ -22,7 +22,7 @@ services: restart: on-failure stop_grace_period: 1m ports: - - 5432:5432 + - ${POSTGRES_PORT-5432}:5432 volumes: - ./data/postgres:/var/lib/postgresql/data environment: diff --git a/packages/cli/src/executors/system/system.helpers.ts b/packages/cli/src/executors/system/system.helpers.ts index a4fb69b9..823d00b4 100644 --- a/packages/cli/src/executors/system/system.helpers.ts +++ b/packages/cli/src/executors/system/system.helpers.ts @@ -175,7 +175,7 @@ export const generateSystemEnvFile = async () => { envMap.set('POSTGRES_DBNAME', 'tipi'); envMap.set('POSTGRES_USERNAME', 'tipi'); envMap.set('POSTGRES_PASSWORD', postgresPassword); - envMap.set('POSTGRES_PORT', String(5432)); + envMap.set('POSTGRES_PORT', String(data.postgresPort || 5432)); envMap.set('REDIS_HOST', 'tipi-redis'); envMap.set('REDIS_PASSWORD', redisPassword); envMap.set('DEMO_MODE', String(data.demoMode || 'false')); diff --git a/packages/shared/src/schemas/env-schemas.ts b/packages/shared/src/schemas/env-schemas.ts index 5e8cee94..bab550a8 100644 --- a/packages/shared/src/schemas/env-schemas.ts +++ b/packages/shared/src/schemas/env-schemas.ts @@ -63,5 +63,5 @@ export const envSchema = z.object({ export const settingsSchema = envSchema .partial() - .pick({ dnsIp: true, internalIp: true, appsRepoUrl: true, domain: true, storagePath: true, localDomain: true, demoMode: true, guestDashboard: true }) + .pick({ dnsIp: true, internalIp: true, postgresPort: true, appsRepoUrl: true, domain: true, storagePath: true, localDomain: true, demoMode: true, guestDashboard: true }) .and(z.object({ port: z.number(), sslPort: z.number(), listenIp: z.string().ip().trim() }).partial());