-
Notifications
You must be signed in to change notification settings - Fork 214
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
Allow runtime configuration of nginx listening port #3219
Conversation
Size Change: 0 B Total Size: 934 kB ℹ️ View Unchanged
|
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 tried changing the port from 8080 to something else locally, and saw that docker-compose.yaml
port needs to change, too:
Line 333 in 90396b2
- "50290:8080" |
Can we set the env variable on the parent directory? Or do we need to add documentation saying that the port needs to be updated if the env variable inside frontend/
directory is set to something different than 8080?
We can, but it's just support for testing a feature that shouldn't need to be tested after this. I guess if we want it to be an end-to-end test, we can set the variable in |
I guess we will not change the 8080 locally anyways, so I'm going to approve this PR. I'm not sure if we should add a comment in |
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.
LGTM!
Fixes
Related to https://github.com/WordPress/openverse-infrastructure/pull/648
Description
ECS FARGATE requires that container and host ports match on a container definition. In the related PR we tried to map Nuxt to a different host port, in order to allow Nginx to listen on 8443 so that the target group port doesn't need to change. We did that by juggling the host ports, but we can't have different host and container ports. Nuxt lets you override the port by passing
-p
, but we need to enable runtime configuration of the Nginx port by using an environment variable.The net change in this PR is that you should be able to pass
OPENVERSE_NGINX_LISTEN_PORT
environment variable to the container and have Nginx listen on a port other than 8080. Proof that it works is in the fact that it still listens to 8080 now, as that is set as the default for that variable in the container build.Testing Instructions
Run
just build frontend_nginx && just frontend/up
and confirm you can still access thefrontend_nginx
service atlocalhost:50290
. You also need to run the frontend locally on port8443
usingjust frontend/dev
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin