support ALLOWED_HOSTS env var, fix Dockerfile missing source files

- parse ALLOWED_HOSTS into vite server.allowedHosts for LAN/tailscale access
- copy src/, public/, vite.config.ts, tsconfig.json into Docker runtime stage
  (dev server needs these, only dist/ was copied before)
- pass ALLOWED_HOSTS through docker-compose

Ref #10
This commit is contained in:
luccast
2026-01-28 09:00:42 -05:00
parent 2155d0cffa
commit ff6fed5932
4 changed files with 16 additions and 0 deletions
+4
View File
@@ -3,3 +3,7 @@
# Clawdbot gateway auth token
CLAWDBOT_API_TOKEN=
# Comma-separated list of allowed hosts for the dev server
# Example: ALLOWED_HOSTS=myhost.local,192.168.1.100,.mydomain.com
ALLOWED_HOSTS=
+4
View File
@@ -24,6 +24,10 @@ COPY package*.json ./
RUN npm ci
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/src ./src
COPY --from=builder /app/public ./public
COPY --from=builder /app/vite.config.ts ./
COPY --from=builder /app/tsconfig.json ./
EXPOSE 3000
+1
View File
@@ -5,4 +5,5 @@ services:
- "3000:3000"
environment:
- CLAWDBOT_API_TOKEN=${CLAWDBOT_API_TOKEN}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-}
restart: unless-stopped
+7
View File
@@ -4,7 +4,14 @@ import viteReact from '@vitejs/plugin-react'
import viteTsConfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'
const allowedHosts = process.env.ALLOWED_HOSTS
? process.env.ALLOWED_HOSTS.split(',').map(host => host.trim()).filter(Boolean)
: undefined
export default defineConfig({
server: {
allowedHosts,
},
plugins: [
viteTsConfigPaths({
projects: ['./tsconfig.json'],