I have SvelteKit deployed to "CP" which depends on my Hono/Bun + MySQL
How to do this if I'm still in dev mode?
18 Replies
alternatively, for production, I can use Azure Cloud in order to connect my frontend to backend
but I'm looking ways to integrate Docker Image I created earlier for localhost testing and it worked
my problem right now Cloudflare Pages code I deployed(frontend) is not connecting with my Docker Image that has Backend + MySQL in the same compose
I was hoping to make it work with Docker as it's for learning/testing purposes and FREE TO USE
Anyone?
How are you trying to connect? Are you using the TCP socket api or an http adapter?
I remember putting cloudflare adapter
Earlier it worked Localhost to Docker Compose
Surprisingly, I even got the ip address of the docker image, replaced with localhost like
Ip-address:3000/api
Still didn’t work
Help
What errors are you getting?
It’s not even connecting lol, 500
So do you see errors in wrangler logs?
I’m not using wrangler
I’m connecting from CP to Docker
?
Then how are you testing the pages project?
Wait are you trying to connect a production pages deployment to a local docker container?
Isn’t it dev/prod at the same time?
This is my current state 😂
You'll need to make it so the pages project can reach the docker container. Which mean you'll either have to open ports on your firewall or find a cloud host for it
I think I like the first option, atm cloud hosting are paid, I just want something free for still undergoing project
You'll have to figure out how to open your ports on your router and forward to the docker container but it should work after that
I attempted to use Cloudflare Tunnels, I failed on that as well
I created cloudflare tunnel under the same bridge I have created for others
and then took the Gateway API, pasted in my frontend, still did not listen to it : )
anyone?)
What container are you using for your http to MySQL adapter?
It’s containerized under docker compose
Full screenshot of the compose
Yeah I see containers for cloudflared, MySQL, HA proxy and whatever ifarmo is. Because you are using cloudflared you need to be using an sql driver that supports http and not tcp. You will then need a container in your compose to translate that http to MySQL container