diff --git a/.circleci/circle.yml b/.circleci/circle.yml deleted file mode 100644 index 3eb15ad2..00000000 --- a/.circleci/circle.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -jobs: - build: - working_directory: ~/app - docker: - - image: circleci/node:8 - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: npm-install - command: npm install - - save_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - paths: - - .node_modules - - run: - name: test - command: npm test diff --git a/Dockerfile b/Dockerfile index 7bbfc010..f34b0acf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,5 +5,7 @@ WORKDIR /app RUN mkdir static RUN npm install -EXPOSE 1443 +ENV PORT=1443 +EXPOSE $PORT + CMD ["npm", "start"] diff --git a/circle.yml b/circle.yml index e757db9b..10acfda0 100644 --- a/circle.yml +++ b/circle.yml @@ -2,3 +2,10 @@ machine: node: version: 8.0.0 +deployment: + latest: + branch: master + commands: + - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS + - docker build . -t mozilla/portal:latest + - docker push mozilla/portal:latest diff --git a/docs/docker.md b/docs/docker.md index fa50b4fd..d0702397 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -1,9 +1,10 @@ Environment Variables: +PORT - port the server will listen on (defaults to 1443) P2P_S3_BUCKET - the S3 bucket name P2P_REDIS_HOST - host name of the redis server NODE_ENV - production Example -docker run --net=host -e 'NODE_ENV=production' -e 'P2P_S3_BUCKET=testpilot-p2p-dev' -e 'P2P_REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' +docker run --net=host -e 'NODE_ENV=production' -e 'P2P_S3_BUCKET=testpilot-p2p-dev' -e 'P2P_REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' mozilla/portal:latest diff --git a/server/config.js b/server/config.js index 77d7cfa9..7e793f78 100644 --- a/server/config.js +++ b/server/config.js @@ -20,7 +20,7 @@ const conf = convict({ format: 'port', default: 1443, arg: 'port', - env: 'P2P_LISTEN_PORT' + env: 'PORT' }, env: { format: ['production', 'development', 'test'],