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

Simplify development environment setup via Docker Compose #1221

Merged
merged 2 commits into from
Aug 16, 2017

Conversation

damassi
Copy link
Member

@damassi damassi commented Aug 12, 2017

This is still WIP as I need to test a few things out, but what this PR does is wrap all of our local development environment services (mongo, elasticsearch, node) into one command docker-compose up. This allows us to keep things contained when working locally and free of global installs. Future setup is along the lines of

Note that this only applies only to local development environments and does not change existing deployment configuration.

@damassi damassi self-assigned this Aug 12, 2017
@damassi damassi requested a review from kanaabe August 12, 2017 01:07
@damassi damassi force-pushed the dockerize-dev-environment branch 3 times, most recently from e739d49 to 62a20ab Compare August 13, 2017 21:14
@damassi damassi requested a review from eessex August 14, 2017 18:28
@damassi damassi assigned kanaabe and unassigned damassi Aug 14, 2017
@@ -7,6 +7,7 @@ ARTSY_URL=http://localhost:5000/__gravity
SESSION_SECRET=p0s1tr0n
MONGOHQ_URL=mongodb://localhost:27017/positron-test
ELASTICSEARCH_URL=http://localhost:9200
ELASTICSEARCH_PORT=9200
Copy link
Contributor

Choose a reason for hiding this comment

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

This also needs to be added to .env.example.

ports:
- "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}"
mongodb:
image: mongo:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

I was getting a connection error from mongo client. I might be missing something, but possibly the port for mongodb also needs to be forwarded and exposed like it is for elasticsearch?

ports:
  - 27017:27017

@yuki24
Copy link
Contributor

yuki24 commented Aug 15, 2017

👏 great PR @damassi! I wish positron had this before I set that up.

@damassi damassi force-pushed the dockerize-dev-environment branch from 62a20ab to 6466c93 Compare August 15, 2017 23:43
@bhoggard bhoggard self-requested a review August 15, 2017 23:56
@yuki24 yuki24 merged commit 7621ef8 into artsy:master Aug 16, 2017
@acjay acjay removed the In progress label Aug 16, 2017
@damassi damassi deleted the dockerize-dev-environment branch August 16, 2017 00:10
ports:
- "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}"
mongodb:
image: mongo:latest

Choose a reason for hiding this comment

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

You should lock to a specific version. Production is running 3.0.6, so I would set it to

mongo:3.0

WORKDIR /usr/src/app
COPY package.json .
COPY . .
RUN yarn install

Choose a reason for hiding this comment

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

To avoid docker cache invalidation, do yarn install before the second COPY command.

version: '2'
services:
elasticsearch:
image: elasticsearch:latest

Choose a reason for hiding this comment

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

Again, lock to a specific version.

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.

5 participants