-
Notifications
You must be signed in to change notification settings - Fork 3
Removing nginx serving of the frontend for local setups #1179
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
Conversation
38fd7f8 to
8545b1a
Compare
74ff313 to
9b9d8b6
Compare
gumaerc
left a 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.
I was able to get this working, but I had to make some tweaks to the nginx configuration:
185a01b to
c0cdeb0
Compare
|
@gumaerc I addressed your feedback and also updated the readme to reflect the new config file locations. |
gumaerc
left a 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.
This looks good to me now, however I will leave you a reminder to put up a PR in ol-infrastructure to set MITOPEN_APP_BASE_URL and MITOPEN_API_BASE_URL in our various deployment environments before releasing this.
mbertrand
left a 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.
Using my old .env, I can't seem to login via django admin (tried via both ports/domains), I always get a CSRF error, unless I set both MITOPEN_API_BASE_URL and MITOPEN_APP_BASE_URL to localhost with different ports. Even setting them both to open.odl.local with different ports leads to a CSRF error.
Renamed my old .env and tried to use env/backend.local.env, env/shared.local/end, frontend.local.env but it couldn't seem to find shared.local.env at least where COMPOSE_PROFILES is, kept getting the error "no service selected"
|
@rhysyngsun I will test this again on Monday and take a closer look at the settings Matt mentioned above, but we should probably hold off merging until we know it picks up those settings properly. |
|
env/frontend.local.example.env
Outdated
| @@ -0,0 +1,2 @@ | |||
| # MITOPEN_AXIOS_WITH_CREDENTIALS=True | |||
| # WEBPACK_ANALYZE=True | |||
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.
EMBEDLY_KEY= here as well.
MITOPEN_AXIOS_WITH_CREDENTIALS isn't needed as it's in the committed file. Are the .local.env files intended only for secrets (aside from where it makes sense to group related variables)? Thinking WEBPACK_ANALYZE can go in frontend.env as well.
I tested this again today and confirmed that |
c0cdeb0 to
4db5c53
Compare
mbertrand
left a 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.
No longer getting a CSRF error
env/frontend.env
Outdated
| NODE_ENV=development | ||
| PORT=8062 | ||
| MITOPEN_AXIOS_WITH_CREDENTIALS=true | ||
| WEBPACK_ANALYZE=True |
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 causes my watch container to throw an error and exit
WEBPACK_ANALYZE: Invalid bool input: "True"
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 causes my watch container to throw an error and exit
WEBPACK_ANALYZE: Invalid bool input: "True"
I get this same error
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.
@rhysyngsun I think this needs to be lowercase true because the var is evaluated by Javascript
4db5c53 to
44464ef
Compare
mbertrand
left a 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.
👍
1b9f193 to
c1d0c9c
Compare
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/4602
Closes https://github.com/mitodl/hq/issues/4611
Description (What does it do?)
env_fileso that it's split up between frontend vs. backend so it's generally cleaner and not as noisy.How can this be tested?
.envfile as I left support for that in placeenv/frontend.local.envandenv/backend.local.env. There's alsoenv/shared.local.env, but that is mainly for theMITOPEN_API_BASE_URLandMITOPEN_APP_BASE_URLvars..envfile(s) that are now defined by default in the checked in.envfiles. A lot of time we just ended up leaving what was in.envand this should hopefully make that file a lot less noisy.docker compose upwith the different combinations ofCOMPOSE_PROFILESset.8062(e.g. http://open.odl.local:8062/). The API and django-admin are still on port8063.docker compose run --rm web bash, etc.