Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add dev docker-compose file to manage supporting services #525
Add dev docker-compose file to manage supporting services #525
Changes from 1 commit
c32828c
644e16a
e10956c
6338341
97f2bb9
9696780
aa4df38
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove stale comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a significant deviation from the parent
docker-compose.yml
. Is this runningpyxform
from source?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just overriding the port in the command of the pyxform-http docker file: https://github.com/getodk/pyxform-http/blob/master/Dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the standard
command
be used, and this container's port80
be exposed locally on port5001
? That would seem to simplify this section, and also protect against future divergence.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't expose
ports
when usinghost
networking mode. Andhost
networking is required so that Enketo can communicate with Central viahttp://localhost:8989
, which is running on the host.I know we can use
host.docker.internal
to access services running on the host from thebridge
container but configuration in Enketo and Central doesn't really support that. For example, Central usesenv.domain
to generate URLs in OpenRosa manifest, whose value ishttp://localhost:8989
in local environment.I had tried modifying
/etc/hosts
file in the Enketo container to maplocalhost
to the IP assigned by docker to thehost.docker.internal
but Enketo using discontinued/deprecatedrequest.js
doesn't respects values in host file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you got a source for this? I couldn't find anything obvious in the
request
issue tracker.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way requestjs resolves domain name has to do with it:
request/request#2491
Note: above issue closed due to staleness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble reproducing this issue. Is it possible this has been resolved by enketo's move to
@cypress/request
(introduced by 37b8f8b2f0b057e7adaa2da472f88ab8a5e460e0 in April 2024)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to map
localhost
to the IP Address ofhost-gateway
in Enketo container, that didn't work. Localhost was still resolving to 127.0.0.1.So I ended up adding a custom domain in my local hosts file and changing
default.env.domain
to that host in the backend repository and now everything works. I have to access central via that custom host instead of localhost, which is fine. I have updated the instructions in readme file as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change to reduce the number of redis containers required? If so, is the increased complexity in these scripts and the deviation from the standard
docker-compose.yml
worth the savings?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. Originally I wanted this PR to facilitate Enketo development as well and Enketo suggests to run only one redis in development for the easiness. I have now removed the port substitution from this command and starting two redis instances.
I still need to substitute
enketo_redis_main
andenketo_redis_cache
with localhost because of host network mode.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to
pyxform
config above, it would be great if there was a way to achieve this without having to modifyfiles/enketo/start-enketo.sh
and make fragile changes withsed
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.