-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Forwarding to current port #136
Comments
For both of those, you mapped to port 80 on the host. If you want to have tests on a different port, you need to map to it. The way it works is like |
Do I need to expose that Port in the dockerfile as well? |
Yes that's correct! Any port that you use from inside the container needs:
But since each container is isolated, what you really should care about are the ports you map to on the host (the second in the mapping). Using port 80 inside each of the containers should work best unless you are doing some significant change to services in the container that require running the expfactory server on another port. |
Hi Vanessa, Unfortunately, mapping 80:3391 fails with Bind for 0.0.0.0:80 failed: port is already allocated. Maybe I'm doing it wrong: Do I need to actually use docker build twice? |
That means you have something else running on port 80, perhaps another container? Or nginx / apache on your host? What is your goal here - to run two different experiment servers at once on the same host? if you want to do that, you need to map each container to a different port on the host, e.g.,
|
Hi Vanessa, What i would love to achieve is having one set of tests under URL/testsystem1 and the other one under URL/testsystem2 OR The port mappings you suggested above leed to the sites not being accessible. I used the dockerfile from this issue-post: #125 Might this be due to the nginx-configuration in the container? Thanks for your help and kind regards! |
The port needs to be exposed in the docker-compose.yml file too, and you likely need to tweak the |
I exposed the ports, but I don't know where to change the DOMAIN_NAME. Where are the settings ? |
Should be these two lines https://github.com/expfactory/expfactory-docker/blob/master/expdj/settings.py#L19. Whether you rebuild or just bind and restart, you can shell into the container to double check that they are changed. |
Thanks for the super quick reply! Ah I see. By the way am i using the wrong version? This seems to be the one that has last been updated two years ago. I always use this to build the container: docker build --no-cache -t expfactory/experiments . But this pulls from Dockerhub not quay.io , right? |
Oh sorry - are you using the expactory-docker code in the repository here, or version 2 of expfactory (at https://expfactory.github.io)? Sorry they are different! If you can clarify which one, I can better help (I thought you were using the one here since the issue is posted here). |
Oh sorry, I use version 2 (the one at https://expfactory.github.io), although it says version 3.1 on the website. I didn't know there where differences by the time I created this issue. |
Hmm, so the way that it works is that when you build your experiment container, internally everything is being served via port 5000, which is then proxy-ed to port 80 (or the same for https). So I suspect that if you want a different port used instead of 80, you'd need to change the nginx configuration there. It might be easiest to add a step to your Dockerfile to add a custom one e.g., see this step and then make sure that you expose the port, and definitely keep all your files in version control so you can reproduce your build. And sorry for the confusion! I've transferred the issue to the correct repository. For some history, releases of expfactory through (I think) 2.5.47 or close to that were the original library, the one used for expfactory.org. The "version 2" of expfactory doesn't refer to 2.x, but to version 3.x and up (releases on pypi https://pypi.org/project/expfactory/). This is the one that builds containers for you with experiements. |
Hi,
I just tried running two sets of tests on the same server mapping to different ports:
First: docker run -d -p 80:80 expfactory/experiments --database "DATABASE" --experiments code,simple-reaction-time,stroop,go-nogo,bart,n-back,tower-of-london,kirby,flanker,stop-signal,reversal-learning,judgement-of-line-orientation-test,information-sampling start
Second: docker run --name="impulsivity" -d -p 3391:80 expfactory/experiments --database "DATABASE" --experiments code,simple-reaction-time,flanker,go-nogo,kirby,stop-signal,bart,stroop,information-sampling,reversal-learning start
Basically it works good but if you start the tests the forwarding leads you to SERVER:80 not SERVER:3391.
Is it possible to change that?
Thanks :)
Tim
The text was updated successfully, but these errors were encountered: