Allow changing port via env

This commit is contained in:
Lucas Winther
2026-07-10 05:38:00 +02:00
parent c2de4241a4
commit 15bf14728a
3 changed files with 8 additions and 5 deletions
+2 -1
View File
@@ -32,5 +32,6 @@ COPY --from=build /app/dist ./dist
RUN mkdir -p /app/data && chown -R bun:bun /app/data RUN mkdir -p /app/data && chown -R bun:bun /app/data
USER bun USER bun
EXPOSE 3000 ENV PORT=3000
EXPOSE $PORT
CMD ["bun", "src/index.ts"] CMD ["bun", "src/index.ts"]
+2 -1
View File
@@ -2,8 +2,9 @@ services:
whisper-web: whisper-web:
build: . build: .
ports: ports:
- "3000:3000" - "${PORT:-3000}:${PORT:-3000}"
environment: environment:
PORT: "${PORT:-3000}"
# Runtime feature flags (Decisions.md D-015). # Runtime feature flags (Decisions.md D-015).
AUTH_ENABLED: "true" # set to "false" to disable login/register AUTH_ENABLED: "true" # set to "false" to disable login/register
volumes: volumes:
+4 -3
View File
@@ -189,9 +189,10 @@ async function developmentServeOptions(): Promise<ServeOptions> {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
const server = serve( const options = IS_PRODUCTION ? await productionServeOptions() : await developmentServeOptions();
IS_PRODUCTION ? await productionServeOptions() : await developmentServeOptions(), options.port = process.env.PORT || 3000;
);
const server = serve(options);
console.log( console.log(
`Server running at ${server.url} (${IS_PRODUCTION ? "production, serving dist/" : "development"})`, `Server running at ${server.url} (${IS_PRODUCTION ? "production, serving dist/" : "development"})`,