GamerC0der commited on
Commit
4f0e5c3
·
1 Parent(s): 8077bb9

Revert to using wrangler for proper Remix compatibility

Browse files

- Add build step back to Dockerfile
- Use wrangler pages dev with 0.0.0.0 binding
- Install wrangler globally for Docker container
- Maintains Cloudflare Pages compatibility while allowing external access

Files changed (1) hide show
  1. Dockerfile +10 -3
Dockerfile CHANGED
@@ -7,7 +7,7 @@ WORKDIR /app
7
  COPY package.json pnpm-lock.yaml ./
8
 
9
  # Install pnpm and dependencies
10
- RUN npm install -g pnpm && pnpm install
11
 
12
  # Copy source code
13
  COPY . .
@@ -20,5 +20,12 @@ ENV NODE_ENV=production \
20
  RUNNING_IN_DOCKER=true \
21
  PORT=7860
22
 
23
- # Start command using pnpm run dev with host binding
24
- CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"]
 
 
 
 
 
 
 
 
7
  COPY package.json pnpm-lock.yaml ./
8
 
9
  # Install pnpm and dependencies
10
+ RUN npm install -g pnpm wrangler && pnpm install
11
 
12
  # Copy source code
13
  COPY . .
 
20
  RUNNING_IN_DOCKER=true \
21
  PORT=7860
22
 
23
+ # Build the application first
24
+ RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm run build
25
+
26
+ # Pre-configure wrangler to disable metrics
27
+ RUN mkdir -p /root/.config/.wrangler && \
28
+ echo '{"enabled":false}' > /root/.config/.wrangler/metrics.json
29
+
30
+ # Start command using wrangler with proper binding
31
+ CMD ["sh", "-c", "wrangler pages dev ./build/client --ip 0.0.0.0 --port 7860 --no-show-interactive-dev-session"]