FROM node:22-bookworm # Install Nginx to perform HTTP header rewriting inside the container RUN apt-get update && apt-get install -y nginx-light && rm -rf /var/lib/apt/lists/* WORKDIR /app # Enable pnpm RUN corepack enable && corepack prepare pnpm@latest --activate # Copy code and build COPY . . RUN pnpm install RUN pnpm run build # Create a default directory for workspaces RUN mkdir -p /app/workspaces # Configure Nginx to spoof Host, Origin, and Referer headers 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/; \ proxy_set_header X-Real-IP 127.0.0.1; \ proxy_set_header X-Forwarded-For 127.0.0.1; \ proxy_http_version 1.1; \ proxy_set_header Upgrade $http_upgrade; \ proxy_set_header Connection "upgrade"; \ } \ }' > /etc/nginx/sites-available/default EXPOSE 3080 # Start Nginx and launch DeepSeek Harness CMD nginx && node --import tsx/esm apps/cli/src/bin.ts web --port 3081 --no-open