-
Notifications
You must be signed in to change notification settings - Fork 288
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
(feat): storefront using reaction docker base #2
Conversation
…olloclient to see errors returned from the server
…updated README with steps on how to connect this app with the reaction graphql services
@aldeed @ticean we were able to get this docker setup working but one issue we're having is the |
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.
Just a minor suggestion.
Regarding yarn install, it is a build-stage thing, so it should not be running on dc up
but it should on dc up --build
. If it doesn't, maybe try a full docker-compose down --rmi local
followed by docker-compose build
(and delete node_modules before doing that). Not sure if there is a difference.
After the initial build, it should work to dcrun yarn
before dc up
if there are any lockfile changes not yet installed.
It may help to make the same change I made in reaction docker-compose.yml, to add under service volumes:
- reaction-next-starterkit_node_modules:/usr/local/src/reaction-app/node_modules # do not link node_modules in, and persist it between dc up runs
And under the main volumes:
reaction-next-starterkit_node_modules
src/lib/apollo/initApollo.js
Outdated
@@ -14,7 +14,8 @@ const create = (initialState) => | |||
connectToDevTools: process.browser, | |||
ssrMode: !process.browser, | |||
link: new HttpLink({ | |||
uri: "http://localhost:3030/graphql-alpha", | |||
uri: `${process.env.PROTOCOL}://${process.env.HOST}:${process.env.PORT}/${process.env | |||
.ENDPOINT}`, |
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 would destructure these (including METEOR_TOKEN) from process.env
toward the top of the file and check each one throwing a specific error if it isn't set. That way when someone inevitably starts it up with improper configuration they'll get a more helpful error message like "You must set PROTOCOL env variable".
I'm also not sure why it would be necessary to break this up rather than just having a single GRAPHQL_URL
variable.
….example to have the new variables
…few warnings still need to be resolved
…ep for the ne eslint-config, removed the package-lock file
…ck file this time
… do the clean of the build step, updated readme with new setup steps
…o use the new nextjs server port
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, I was able to get the projects running with no errors. Good work!
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.
👍 Works for me
…eation Signed-off-by: Grig Gheorghiu <grig@gheorghiu.net>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Signed-off-by: Janus Reith <mail@janusreith.de>
Issue
Needed the Storefront example application to run within the Reaction Commerce Docker setup. Also needed a way for the Storefront container to communicate with the GraphQl service container.
Solution
Added all the necessary docker config files from the Reaction Base.
Created a network definition that both containers can communicate on.
Testing
Follow the setup steps within the README.
The Storefront app should start and run at localhost:4000 with no errors in the terminal.
Notes
You'll need to run the Storefront app with
docker-compose up -d && docker-compose logs -f web
to see any terminal logs.