Bjarn
Bjarn
CDCloudflare Developers
Created by Bjarn on 3/8/2024 in #general-help
cloudflared tunnel via Docker
Hi! I am using cloudflared in a Docker compose file with the following configuration.
version: '1.0'
services:
app:
container_name: XXX
image: ghcr.io/XXX/XXX:main
# restart: unless-stopped
ports:
- "3000:3000"
networks:
- app
tunnel:
container_name: cloudflared-tunnel
image: cloudflare/cloudflared
# restart: unless-stopped
command: tunnel run
environment:
- TUNNEL_TOKEN=XXXX
networks:
- app

networks:
app:
name: app
version: '1.0'
services:
app:
container_name: XXX
image: ghcr.io/XXX/XXX:main
# restart: unless-stopped
ports:
- "3000:3000"
networks:
- app
tunnel:
container_name: cloudflared-tunnel
image: cloudflare/cloudflared
# restart: unless-stopped
command: tunnel run
environment:
- TUNNEL_TOKEN=XXXX
networks:
- app

networks:
app:
name: app
My problem here is that it keeps throwing the following errors even though it seems to work just fine (request come through and app is served correctly). However, when enabling "restart: unless-stopped", it doesn't work as it keeps restarting. Wasn't able to find anything on this. Really appreciate the help!
cloudflared-tunnel | 2024-03-08T21:01:06Z ERR Request failed error="context canceled" connIndex=1 dest=https://XXXX/ event=0 ip=XXXX type=http
cloudflared-tunnel | 2024-03-08T21:06:05Z ERR error="context canceled" connIndex=1 event=1 ingressRule=2 originService=http://app:3000
cloudflared-tunnel | 2024-03-08T21:01:06Z ERR Request failed error="context canceled" connIndex=1 dest=https://XXXX/ event=0 ip=XXXX type=http
cloudflared-tunnel | 2024-03-08T21:06:05Z ERR error="context canceled" connIndex=1 event=1 ingressRule=2 originService=http://app:3000
3 replies
CDCloudflare Developers
Created by Bjarn on 8/25/2023 in #pages-help
Use Custom Hostnames to point to Cloudflare Pages project
No description
14 replies
CDCloudflare Developers
Created by Bjarn on 8/8/2023 in #pages-help
High TTFB with Pages
Hi! So, there're kinda two issues here. First one is a high TTFB, averaging 500-800ms for a static Nextjs website. I tried to fix that by creating a cache rule for the website in Cloudflare. However, after I had done that, in some occassions the website returns a blank page with no content. Refreshing a couple of times sometimes returns the correct content, looks like something went wrong with caching. However, is it normal that the TTFB is so high with CF Pages without any extra caching setup?
84 replies
CDCloudflare Developers
Created by Bjarn on 6/8/2023 in #pages-help
Cannot find module '@napi-rs/simple-git-linux-x64-gnu'
Hi again 🙂 I'm trying to deploy a Nextjs project to Pages, a different one to my previous thread. However, this one fails because of the following error:
13:24:40.598 ▲ - info Linting and checking validity of types...
13:24:43.061 ▲ - info Creating an optimized production build...
13:24:45.133 ▲ unhandledRejection Error: Cannot find module '@napi-rs/simple-git-linux-x64-gnu'
13:24:45.133 ▲ Require stack:
13:24:45.133 ▲ - /opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js
13:24:45.134 ▲ at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
13:24:45.134 ▲ at /opt/buildhome/repo/node_modules/next/dist/server/require-hook.js:188:36
13:24:45.134 ▲ at Module._load (node:internal/modules/cjs/loader:920:27)
13:24:45.134 ▲ at Module.require (node:internal/modules/cjs/loader:1141:19)
13:24:45.134 ▲ at require (node:internal/modules/cjs/helpers:110:18)
13:24:45.134 ▲ at Object.<anonymous> (/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js:174:31)
13:24:45.134 ▲ at Module._compile (node:internal/modules/cjs/loader:1254:14)
13:24:45.135 ▲ at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
13:24:45.135 ▲ at Module.load (node:internal/modules/cjs/loader:1117:32)
13:24:45.135 ▲ at Module._load (node:internal/modules/cjs/loader:958:12) {
13:24:45.135 ▲ code: 'MODULE_NOT_FOUND',
13:24:45.135 ▲ requireStack: [ '/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js' ]
13:24:45.135 ▲ }
13:24:45.259 ▲ Error: Command "npm run build" exited with 1
13:24:40.598 ▲ - info Linting and checking validity of types...
13:24:43.061 ▲ - info Creating an optimized production build...
13:24:45.133 ▲ unhandledRejection Error: Cannot find module '@napi-rs/simple-git-linux-x64-gnu'
13:24:45.133 ▲ Require stack:
13:24:45.133 ▲ - /opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js
13:24:45.134 ▲ at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
13:24:45.134 ▲ at /opt/buildhome/repo/node_modules/next/dist/server/require-hook.js:188:36
13:24:45.134 ▲ at Module._load (node:internal/modules/cjs/loader:920:27)
13:24:45.134 ▲ at Module.require (node:internal/modules/cjs/loader:1141:19)
13:24:45.134 ▲ at require (node:internal/modules/cjs/helpers:110:18)
13:24:45.134 ▲ at Object.<anonymous> (/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js:174:31)
13:24:45.134 ▲ at Module._compile (node:internal/modules/cjs/loader:1254:14)
13:24:45.135 ▲ at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
13:24:45.135 ▲ at Module.load (node:internal/modules/cjs/loader:1117:32)
13:24:45.135 ▲ at Module._load (node:internal/modules/cjs/loader:958:12) {
13:24:45.135 ▲ code: 'MODULE_NOT_FOUND',
13:24:45.135 ▲ requireStack: [ '/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js' ]
13:24:45.135 ▲ }
13:24:45.259 ▲ Error: Command "npm run build" exited with 1
Locally, it builds fine but it doesn't on Pages. The repo is available here: https://github.com/spectate/docs Thanks!
7 replies
CDCloudflare Developers
Created by Bjarn on 6/8/2023 in #pages-help
Pages not creating Worker, NextJS returns 404
295 replies
CDCloudflare Developers
Created by Bjarn on 5/10/2023 in #general-help
Cloudflare Pages incorrect node version
Hi! I have my environment variable set to NODE_VERSION=18 in the Pages configuration, however, it uses v17:
The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0". Got "17.9.1"
The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0". Got "17.9.1"
This started 10 days ago.
8 replies