-
Notifications
You must be signed in to change notification settings - Fork 3
[NextJS] Local docker setup #1538
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
7dc1c3c to
e824aff
Compare
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.
@jonkafton Opinion: We shouldn't use a frontends/main/.env.example file.
I know NextJS will use a .env file, but
- the majority of the time, developers are using docker to run the app. Docker has the env vars in the environment, populated from
env/shared.env, etc - If you're running outside of docker, let's use the same env files—
env/shared.env,env/frontend.env, etc.- They can be loaded into shell automatically via some other tool, your choice. I use https://direnv.net/ for this (which @rhysyngsun suggested) and have been very happy with it.
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.
Yes, agree - all of these ended up being public, so can live in the committed env files.
1f43fbb to
f6c4d89
Compare
2c15cbf to
a20b230
Compare
| const MITOL_API_BASE_URL = process.env.NEXT_PUBLIC_MITOL_API_BASE_URL | ||
| const IS_SERVER = typeof window === "undefined" | ||
| const MITOL_API_BASE_URL = IS_SERVER | ||
| ? // NEXT_SERVER_MITOL_API_BASE_URL is generally only needed for local-dev |
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.
We'll hopefully end up addressing the API from within a local network (so the server isn't making API requests over the internet), though for now this holds true
* enable running nextjs in docker * run storybook too
* enable running nextjs in docker * run storybook too
* enable running nextjs in docker * run storybook too
* enable running nextjs in docker * run storybook too
* enable running nextjs in docker * run storybook too
* enable running nextjs in docker * run storybook too
* enable running nextjs in docker * run storybook too
What are the relevant tickets?
For https://github.com/mitodl/hq/issues/5396 [the local development half]
Description (What does it do?)
Enables running NextJS frontend in docker locally.
How can this be tested?
On this branch:
docker compose updocker compose logs watch --follow --tail=500in a new terminal to see the watch logs. You should see NextJS logsmain):