Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot proxy requests to another service within docker-compose #476

Open
crisguitar opened this issue Jan 4, 2021 · 1 comment
Open

Comments

@crisguitar
Copy link

I created a proxy that works fine when running outside of a container but as soon as I try with docker compose I get 504 for all my requests:

const backendUri = process.env.BE_URI || "localhost" // either localhost or api in case of docker-compose

app.use(
  baseUri,
  proxy(`http://${backendUri}:8081`, {
    proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
      // do something with request
      return proxyReqOpts;
    }
  })
);

I have seen similar issues closed but none with a fix or a comment on how to fix it.

Is anyone able to help?

Thanks!

@hpl002
Copy link

hpl002 commented Jan 7, 2021

Could you post the docker-compose file?

Assuming you have had a look at https://docs.docker.com/compose/networking/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants