2026-09-03 06:09:59 +00:00
|
|
|
FROM node:22-bookworm
|
|
|
|
|
|
2026-09-04 18:25:28 +00:00
|
|
|
# Install Nginx
|
|
|
|
|
RUN apt-get update && apt-get install -y nginx-light && rm -rf /var/lib/apt/lists/*
|
2026-09-03 15:17:10 +00:00
|
|
|
|
2026-09-03 06:09:59 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-09-03 15:17:10 +00:00
|
|
|
# Enable pnpm
|
2026-09-03 06:09:59 +00:00
|
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
|
|
2026-09-04 18:25:28 +00:00
|
|
|
# Copy source code
|
2026-09-03 06:09:59 +00:00
|
|
|
COPY . .
|
2026-09-04 18:25:28 +00:00
|
|
|
|
|
|
|
|
# Patch out the client-side browser/localhost restriction before building
|
|
|
|
|
RUN grep -rl "settings are unavailable" . | xargs -r sed -i 's/settings are unavailable in this browser/settings enabled/g' || true
|
|
|
|
|
RUN find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -exec sed -i 's/isLocalhost/true/g' {} + || true
|
|
|
|
|
|
|
|
|
|
# Install dependencies and build the patched source
|
2026-09-03 06:09:59 +00:00
|
|
|
RUN pnpm install
|
|
|
|
|
RUN pnpm run build
|
|
|
|
|
|
2026-09-04 18:25:28 +00:00
|
|
|
# Create workspaces directory
|
|
|
|
|
RUN mkdir -p /app/workspaces
|
2026-09-04 17:02:18 +00:00
|
|
|
|
2026-09-04 18:25:28 +00:00
|
|
|
# Nginx config spoofing local loopback
|
2026-09-04 17:49:04 +00:00
|
|
|
RUN echo 'server { \
|
|
|
|
|
listen 3080; \
|
|
|
|
|
location / { \
|
|
|
|
|
proxy_pass http://127.0.0.1:3081; \
|
|
|
|
|
proxy_set_header Host 127.0.0.1:3081; \
|
|
|
|
|
proxy_set_header Origin http://127.0.0.1:3081; \
|
|
|
|
|
proxy_set_header Referer http://127.0.0.1:3081/; \
|
2026-09-04 18:25:28 +00:00
|
|
|
proxy_set_header X-Real-IP 127.0.0.1; \
|
|
|
|
|
proxy_set_header X-Forwarded-For 127.0.0.1; \
|
2026-09-04 17:49:04 +00:00
|
|
|
proxy_http_version 1.1; \
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade; \
|
|
|
|
|
proxy_set_header Connection "upgrade"; \
|
|
|
|
|
} \
|
|
|
|
|
}' > /etc/nginx/sites-available/default
|
|
|
|
|
|
2026-09-03 06:09:59 +00:00
|
|
|
EXPOSE 3080
|
|
|
|
|
|
2026-09-04 18:25:28 +00:00
|
|
|
CMD nginx && node --import tsx/esm apps/cli/src/bin.ts web --port 3081 --no-open
|