Allow changing port via env
This commit is contained in:
+2
-1
@@ -32,5 +32,6 @@ COPY --from=build /app/dist ./dist
|
||||
RUN mkdir -p /app/data && chown -R bun:bun /app/data
|
||||
USER bun
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
EXPOSE $PORT
|
||||
CMD ["bun", "src/index.ts"]
|
||||
|
||||
+2
-1
@@ -2,8 +2,9 @@ services:
|
||||
whisper-web:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "${PORT:-3000}:${PORT:-3000}"
|
||||
environment:
|
||||
PORT: "${PORT:-3000}"
|
||||
# Runtime feature flags (Decisions.md D-015).
|
||||
AUTH_ENABLED: "true" # set to "false" to disable login/register
|
||||
volumes:
|
||||
|
||||
+4
-3
@@ -189,9 +189,10 @@ async function developmentServeOptions(): Promise<ServeOptions> {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const server = serve(
|
||||
IS_PRODUCTION ? await productionServeOptions() : await developmentServeOptions(),
|
||||
);
|
||||
const options = IS_PRODUCTION ? await productionServeOptions() : await developmentServeOptions();
|
||||
options.port = process.env.PORT || 3000;
|
||||
|
||||
const server = serve(options);
|
||||
|
||||
console.log(
|
||||
`Server running at ${server.url} (${IS_PRODUCTION ? "production, serving dist/" : "development"})`,
|
||||
|
||||
Reference in New Issue
Block a user