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

chore(container): Correct webpack binding in container #1023

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

bastilian
Copy link
Member

@bastilian bastilian commented Mar 1, 2021

This corrects the binding behaviour of webpack dev server when it is running within a container.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Copy link
Contributor

@akofink akofink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in Slack: this prevents the proxy from being able to access a local API (i.e. localhost:3000 for compliance-backend); however, the dns issue seems to be resolved.

@skateman
Copy link
Member

skateman commented Mar 2, 2021

I investigated further the issue with the DNS servers and if the host OS uses systemd-resolved, podman copies /run/systemd/resolve/resolv.conf for host networked containers, which in my case somehow only contains the DNS servers provided by my ISP. As this file is auto-generated, I tried to mess with the DNS priorities in my NetworkManager but that didn't really help me.

containers/podman#3277 (comment)
containers/podman#7616

If we're not using host networking for the proxy, the API is basically inaccessible as it is running in a separate pod and podman doesn't support host.docker.internal or anything similar like host.podman.internal and according to what I found, they are suggesting people to just use --net=host 😕

@akofink
Copy link
Contributor

akofink commented Mar 11, 2021

I think we can close this one. As @skateman says, we were hitting issues with new Fedora 33 'features' 😆

@skateman
Copy link
Member

I'm still struggling with the frontend not listening on 0.0.0.0 so I have to keep stashing stuff when git-pulling.

@akofink
Copy link
Contributor

akofink commented Mar 11, 2021

Ok, sure. @bastilian could we repurpose this PR to fix just the bind?

@bastilian bastilian changed the title chore(container): Use non-host network mode chore(container): Correct webpack binding in container Mar 12, 2021
@bastilian
Copy link
Member Author

@skateman The binding should now work out of the box.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Seal of Approval

@@ -6,4 +6,6 @@ if [[ ! -d "/compliance/node_modules/@redhat-cloud-services" ]]; then
cd /compliance; /usr/bin/npm install;
fi

export IN_DOCKER='true';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason the Docker compose documentation is not right. A environment variable defined in the .env file doesn't seem to overwrite the one in the compose file[1].

[1] https://docs.docker.com/compose/environment-variables/

@bastilian bastilian merged commit a391010 into RedHatInsights:master Mar 12, 2021
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

Successfully merging this pull request may close these issues.

3 participants