Skip to content
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

Merged
merged 18 commits into from
Apr 6, 2018

Conversation

nnnnat
Copy link
Contributor

@nnnnat nnnnat commented Apr 4, 2018

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.

@nnnnat nnnnat changed the title [WIP] (feat): storefront using reaction docker base (feat): storefront using reaction docker base Apr 4, 2018
@nnnnat
Copy link
Contributor Author

nnnnat commented Apr 4, 2018

@aldeed @ticean we were able to get this docker setup working but one issue we're having is the yarn install doesn't seem to install anything when running docker-compose up or docker-compose up --build. If we run yarn install locally before starting the container everything works fine. Not sure if I'm setting the build env correctly.

Copy link
Contributor

@aldeed aldeed left a 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

@@ -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}`,
Copy link
Contributor

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.

Copy link
Member

@willopez willopez left a 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!

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Works for me

@mikemurray mikemurray merged commit 93550b7 into master Apr 6, 2018
@mikemurray mikemurray deleted the feat-nnnnat-docker-setup branch April 6, 2018 23:47
griggheo added a commit that referenced this pull request Aug 10, 2018
griggheo added a commit that referenced this pull request Jan 27, 2020
…eation

Signed-off-by: Grig Gheorghiu <grig@gheorghiu.net>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 12, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request Apr 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
janus-reith pushed a commit to janus-reith/example-storefront that referenced this pull request May 19, 2020
Signed-off-by: Janus Reith <mail@janusreith.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants