diff --git a/Dockerfile b/Dockerfile index 5b85c7f..0a751d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ FROM oven/bun:1.3.11-alpine AS runner WORKDIR /app/dist ENV NODE_ENV=production -ENV HOST=0.0.0.0 +ENV HOST=localhost ENV PORT=3000 ENV DATABASE_PATH=/data/excalidraw.sqlite diff --git a/README.md b/README.md index a51e7c4..a966a1b 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,8 @@ docker run --rm -p 3000:3000 -v "$PWD/excali-box-data:/data" excali This will make the data persistent in the `excali-box-data` folder in the current directory, the site will be available at `localhost:3000`. -> Note that this command will bind to ALL interfaces. If you use a rev -> proxy, you may want to bind to locahost instead, you can do that by setting the `HOST` environment variable to `localhost`: +By default, this image binds to `localhost`. To expose it on all interfaces, set `HOST=0.0.0.0`: ```bash -docker run --rm -p 3000:3000 -v "$PWD/excali-box-data:/data" -e HOST=localhost excali +docker run --rm -p 3000:3000 -v "$PWD/excali-box-data:/data" -e HOST=0.0.0.0 excali ``` diff --git a/src/server.tsx b/src/server.tsx index dd9b9f1..8ed35f5 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -8,7 +8,7 @@ export function createServer() { return { port: Number(process.env.PORT ?? "3000"), - hostname: process.env.HOST ?? "0.0.0.0", + hostname: process.env.HOST ?? "localhost", routes: { "/": (request: Request) => { const drawing = drawingStore.ensureInitialDrawing();