From 6466c93ecdeb39ea0605cd06a5b6b9802692e3c9 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Fri, 11 Aug 2017 17:59:22 -0700 Subject: [PATCH 1/2] Initial working setup --- .dockerignore | 2 ++ .env.test | 1 + .gitignore | 1 + Dockerfile | 6 ++++++ docker-compose.yml | 18 ++++++++++++++++++ 5 files changed, 28 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..93f136199 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/.env.test b/.env.test index e963f6d00..7592cc8f6 100644 --- a/.env.test +++ b/.env.test @@ -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 SALT=$2a$10$PJrPMBadu1NPdmnshBgFbe API_MAX=100 API_PAGE_SIZE=10 diff --git a/.gitignore b/.gitignore index 492480ba4..e3cd751c3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ dump.rdb .env.ignore node_modules .vscode +data diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..440ee7381 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:7 +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app +COPY package.json . +COPY . . +RUN yarn install diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..7e2d79a53 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '2' +services: + elasticsearch: + image: elasticsearch:latest + ports: + - "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}" + mongodb: + image: mongo:latest + server: + build: . + command: make s + ports: + - "${PORT}:${PORT}" + depends_on: + - elasticsearch + - mongodb + volumes: + - .:/usr/src/app From 9e7f685d7bf2b253bdd88b50fcfbad3d3986dd0f Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 15 Aug 2017 16:59:22 -0700 Subject: [PATCH 2/2] Update ENV vars --- .env.example | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 949272cb9..29cc1e009 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,12 @@ API_URL=http://localhost:3005/api FORCE_URL=https://staging.artsy.net ARTSY_URL=https://stagingapi.artsy.net SESSION_SECRET=p0s1tr0n -MONGOHQ_URL=mongodb://localhost:27017/positron +ELASTICSEARCH_PORT=9200 + +# Local development only for the below; refers to the key in docker-compose.yml +ELASTICSEARCH_URL=http://elasticsearch:9200 +MONGOHQ_URL=mongodb://mongodb:27017/positron + TECH_SUPPORT=craig@artsymail.com DEBUG=api,client,app SALT=$2a$10$PJrPMBadu1NPdmnshBgFbe @@ -34,4 +39,4 @@ INSTANT_ARTICLE_ACCESS_TOKEN=REPLACE FB_PAGE_ID=REPLACE DEFAULT_PARTNER_ID=REPLACE SENTRY_PUBLIC_DSN=REPLACE -SENTRY_PRIVATE_DSN=REPLACE \ No newline at end of file +SENTRY_PRIVATE_DSN=REPLACE