localtunnel / server

server for localtunnel.me
https://localtunnel.me
MIT License
3.01k stars 975 forks source link

Error Deploying Docker Container to Google Cloud Run #135

Open nolandubeau opened 3 years ago

nolandubeau commented 3 years ago

Hello, this is my first time working with your project as well as with Google Cloud Run.

I have successfully loaded the Docker image from Docker Hub and pushed it to Google Container Registry for my project.

When I create the Google Cloud Run service I have tried setting the container port to 8080 as well as 3000. When the service is deployed I receive the following error:

Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.

The logs don't show any additional info. Could you please advise on how to configure the variables to have this deploy successfully on Cloud Run?

Thanks for the great project!

lawrencetaur commented 3 years ago

add

const port = process.env.PORT || 8080; app.listen(port, () => { console.log('Hello world listening on port', port); });
before

app.use(router.routes());

I'm facing another issue where it is creating http urls instead of https.

royletron commented 2 years ago

From what I understand this will be impossible. Once you have the server running, when the clients come to connect they will be assigned a random PORT to connect to on your server - and Cloudrun won't allow anything other than the named port to get through so the connections drop. Generally speaking I have failed in any attempt to get localtunnel running in any sort of docker orchestration:

I am now realising it's down to this fundamental design choice.