mirror of
https://github.com/documenso/documenso.git
synced 2025-11-09 20:12:31 +10:00
feat: server port configurable via PORT env (#2097)
This commit is contained in:
@ -29,6 +29,10 @@ NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000"
|
|||||||
# URL used by the web app to request itself (e.g. local background jobs)
|
# URL used by the web app to request itself (e.g. local background jobs)
|
||||||
NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3000"
|
NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3000"
|
||||||
|
|
||||||
|
# [[SERVER]]
|
||||||
|
# OPTIONAL: The port the server will listen on. Defaults to 3000.
|
||||||
|
PORT=3000
|
||||||
|
|
||||||
# [[DATABASE]]
|
# [[DATABASE]]
|
||||||
NEXT_PRIVATE_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documenso"
|
NEXT_PRIVATE_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documenso"
|
||||||
# Defines the URL to use for the database when running migrations and other commands that won't work with a connection pool.
|
# Defines the URL to use for the database when running migrations and other commands that won't work with a connection pool.
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3003",
|
"dev": "next dev -p 3003",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start -p 3003",
|
||||||
"lint:fix": "next lint --fix",
|
"lint:fix": "next lint --fix",
|
||||||
"clean": "rimraf .next && rimraf node_modules"
|
"clean": "rimraf .next && rimraf node_modules"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -30,4 +30,6 @@ server.use(
|
|||||||
|
|
||||||
const handler = handle(build, server);
|
const handler = handle(build, server);
|
||||||
|
|
||||||
serve({ fetch: handler.fetch, port: 3000 });
|
const port = parseInt(process.env.PORT || '3000', 10);
|
||||||
|
|
||||||
|
serve({ fetch: handler.fetch, port });
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: parseInt(process.env.PORT || '3000', 10),
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
1
packages/tsconfig/process-env.d.ts
vendored
1
packages/tsconfig/process-env.d.ts
vendored
@ -1,5 +1,6 @@
|
|||||||
declare namespace NodeJS {
|
declare namespace NodeJS {
|
||||||
export interface ProcessEnv {
|
export interface ProcessEnv {
|
||||||
|
PORT?: string;
|
||||||
NEXT_PUBLIC_WEBAPP_URL?: string;
|
NEXT_PUBLIC_WEBAPP_URL?: string;
|
||||||
|
|
||||||
NEXT_PRIVATE_GOOGLE_CLIENT_ID?: string;
|
NEXT_PRIVATE_GOOGLE_CLIENT_ID?: string;
|
||||||
|
|||||||
@ -38,6 +38,7 @@
|
|||||||
"globalDependencies": ["**/.env.*local"],
|
"globalDependencies": ["**/.env.*local"],
|
||||||
"globalEnv": [
|
"globalEnv": [
|
||||||
"APP_VERSION",
|
"APP_VERSION",
|
||||||
|
"PORT",
|
||||||
"NEXT_PRIVATE_ENCRYPTION_KEY",
|
"NEXT_PRIVATE_ENCRYPTION_KEY",
|
||||||
"NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY",
|
"NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY",
|
||||||
"NEXTAUTH_SECRET",
|
"NEXTAUTH_SECRET",
|
||||||
|
|||||||
Reference in New Issue
Block a user