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
|
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
@@ -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
@@ -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"})`,
|
||||||
|
|||||||
Reference in New Issue
Block a user