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

build(docker): Allows sharing of network #16937

Merged
merged 1 commit into from
Mar 30, 2018

Conversation

ojongerius
Copy link
Contributor

See #16936 for details

@QuincyLarson QuincyLarson added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Mar 23, 2018
@@ -23,6 +24,7 @@ services:
working_dir: /fcc
command:
- npm
- start
- run
- develop

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.


server:
ports:
- "27017:27017" # Change port if needed

This comment was marked as off-topic.

networks:
- shared

networks: # Used by by other projects like open-api

This comment was marked as off-topic.

This comment was marked as off-topic.

db:
networks:
- shared
freecodecamp:

This comment was marked as off-topic.

# docker-compose -f docker-compose.yml -f docker-compose-shared.yml up
#
version: "2"
services:

This comment was marked as off-topic.

@raisedadead raisedadead changed the title feat: Allows sharing of network, addresses #16936 build(docker): Allows sharing of network Mar 23, 2018
# Run with:
# docker-compose -f docker-compose.yml -f docker-compose-shared.yml up
#
version: "2"

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ojongerius
Copy link
Contributor Author

Note that merging #16825 borked this PR. I'll update based on what went in after the weekend.

@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

1 similar comment
@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

@ojongerius ojongerius force-pushed the feature/share_network branch 2 times, most recently from 0ac9ccb to 242a77c Compare March 25, 2018 21:34
@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

@ojongerius
Copy link
Contributor Author

Merged changes from #16825, good to review when you have time. /cc @Bouncey

#
version: "3"
services:
db:

This comment was marked as off-topic.

db:
image: mongo:3.2.6
ports:
- "27017:27017" # Change port if needed

This comment was marked as off-topic.

version: "3"
services:
db:
image: mongo:3.2.6

This comment was marked as off-topic.

image: mongo:3.2.6
ports:
- "27017:27017" # Change port if needed
freecodecamp:

This comment was marked as off-topic.

ports:
- "27017:27017" # Change port if needed
freecodecamp:
image: node:8.9.4

This comment was marked as off-topic.

image: node:8.9.4
depends_on:
- db
- mailhog

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

environment:
- MONGOHQ_URL=mongodb://db:27017/freecodecamp
volumes:
- .:/app

This comment was marked as off-topic.

- develop
ports:
- "3000:3000" # Change port if needed
mailhog:

This comment was marked as off-topic.

@@ -1,31 +0,0 @@
# Docker Compose sample file for freeCodeCamp

This comment was marked as off-topic.

@@ -56,5 +56,3 @@ public/css/main*
webpack-bundle-stats.html
server/rev-manifest.json
google-credentials.json

docker-compose.yml

This comment was marked as off-topic.

docker-compose up
```

#### Shared

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

CONTRIBUTING.md Outdated

You need to have [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/) installed before executing commands below.
You'll need to have [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/) installed before executing commands below.

This comment was marked as off-topic.

docker-compose up
```

#### Shared

This comment was marked as off-topic.

image: node:8.9.4
depends_on:
- db
- mailhog

This comment was marked as off-topic.

@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

1 similar comment
@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

@ojongerius
Copy link
Contributor Author

@Bouncey ready for re-review 😄

@ojongerius
Copy link
Contributor Author

ojongerius commented Mar 27, 2018

AFAICT to the site to be able to reach mailhog twe'll need to add a datasources file for docker, or make changes to datasources.development and use mailhog instead of localhost when running in Docker.

Before I make those changes (far outside of the scope of this original PR), do you have any preference? I'm erring on staying with datasources.development, adding some complexity to it, but I still believe in a bright future where all the things are neatly containerised.

Edit: have implemented this in 4b4b55ba6dd5b12a899d2e5910240dcdad6c86a9

@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

1 similar comment
@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

@ojongerius
Copy link
Contributor Author

@raisedadead why is the blocked for Beta? Because PR work is a constrained resource?

@raisedadead
Copy link
Member

raisedadead commented Mar 29, 2018

Hi @ojongerius can you take a minute to squash this? I am having trouble pulling the PR. Sorry I just happened to switch machines and dont have my usual dotfiles to rescue me.

Edit: found the problem.

@raisedadead raisedadead force-pushed the feature/share_network branch from 9b0d8aa to 3272f97 Compare March 29, 2018 16:16
@camperbot
Copy link
Contributor

@raisedadead updated the pull request.

@raisedadead
Copy link
Member

Fixed.

Copy link
Member

@raisedadead raisedadead left a comment

Choose a reason for hiding this comment

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

Almost there.

@@ -23,7 +23,14 @@ if (!process.env.SES_ID) {
}
};
debug(`using MailHog server on port ${ds.mail.transport.port}`);
} else {

This comment was marked as off-topic.

@raisedadead
Copy link
Member

Hi @ojongerius I have rebased / sqashed this PR (don't worry the descriptions are in there).
You should just delete you local branch for this PR and then fetch and checkout.

One minor change and we are good to go!

@ojongerius ojongerius force-pushed the feature/share_network branch from 3272f97 to f5321ff Compare March 30, 2018 01:12
@camperbot
Copy link
Contributor

@ojongerius updated the pull request.

build(docker): Expose mailhog port.

build(Docker): Improve wording.

build(docker): Mailhog and network changes.

    * Add mailhog container to shared network to enable connectivity
    * Configure project name for docker compose in .env sample file,
        without it the basename of the repo directory is used, which
        makes it unreachable for other services
    * Set mailhog host to mailhog (instead of localhost) if MAILHOG_HOST
      env var is set
    * Expose 1025 to enable local troubleshooting

build(docker): Update README to reflect compose changes.
@ojongerius ojongerius force-pushed the feature/share_network branch from f5321ff to 02e2b8f Compare March 30, 2018 01:14
@freeCodeCamp freeCodeCamp deleted a comment from camperbot Mar 30, 2018
@ojongerius
Copy link
Contributor Author

@raisedadead thanks for squashing and the suggestion to simplify!

@raisedadead raisedadead merged commit ef37c3b into freeCodeCamp:staging Mar 30, 2018
@ojongerius ojongerius deleted the feature/share_network branch March 30, 2018 07:35
ojongerius added a commit to ojongerius/freeCodeCamp that referenced this pull request Apr 3, 2018
…mage

* upstream/staging: (36 commits)
  docs(documentation): Update readme.md and contributor.md (freeCodeCamp#16990)
  feat: Allows sharing of network (freeCodeCamp#16937)
  fix(seed): Correct typos in es6.json (freeCodeCamp#16972)
  fix(seed): Add test for checking the length of buttons is 2 (freeCodeCamp#16921)
  fix(challenges): Change Symmetric Differences Title (freeCodeCamp#16962)
  fix(challenges): Fix typo in css-grid justify-self challenge (freeCodeCamp#16961)
  chore(package): Update react-freecodecamp-search (freeCodeCamp#16943)
  fix(seed): Fixed issue with approximately always failing (freeCodeCamp#16752)
  fix(lang): Refetch mapUi on language change (freeCodeCamp#16844)
  fix(seed): Make element naming optional (freeCodeCamp#16926)
  fix(seed): Chall seed and test are modified to allow better t (freeCodeCamp#16928)
  fix(projects): Add user stories to projects' description (freeCodeCamp#16924)
  feat(seed): An HTML illustration added (freeCodeCamp#16939)
  fix(gulp): run babel-node with inspect flag in debug (freeCodeCamp#16901)
  fix: remove flash saying JS is disabled
  fix(common): Added expected homeURL that was missing (freeCodeCamp#16922)
  fix(settings): Night mode settings and profile page UI improvements (freeCodeCamp#16806)
  style(settings): Remove extra whitespace
  fix(settings): Report user modal centered to the page
  fix(settings): Fix modal success button hover animation
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants