mirror of
https://github.com/crabwise-ai/crabwalk.git
synced 2026-08-14 00:57:52 +00:00
support ALLOWED_HOSTS env var, fix Dockerfile missing source files (#12)
- 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:
@@ -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=
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -5,4 +5,5 @@ services:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- CLAWDBOT_API_TOKEN=${CLAWDBOT_API_TOKEN}
|
||||
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-}
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user