-
Notifications
You must be signed in to change notification settings - Fork 40
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
Conversation
e739d49
to
62a20ab
Compare
@@ -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 |
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.
This also needs to be added to .env.example
.
ports: | ||
- "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}" | ||
mongodb: | ||
image: mongo:latest |
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 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
👏 great PR @damassi! I wish positron had this before I set that up. |
62a20ab
to
6466c93
Compare
ports: | ||
- "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}" | ||
mongodb: | ||
image: mongo:latest |
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.
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 |
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.
To avoid docker cache invalidation, do yarn install
before the second COPY
command.
version: '2' | ||
services: | ||
elasticsearch: | ||
image: elasticsearch:latest |
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.
Again, lock to a specific version.
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 ofdocker-compose up
Note that this only applies only to local development environments and does not change existing deployment configuration.