Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,4 @@ data/**/*.json
.vscode
*.csv
test-results/*
manifest*.yml
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM node:dubnium-slim

ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}

ARG ELASTICSEARCH_SERVICE_NAME
ENV ELASTICSEARCH_SERVICE_NAME=${ELASTICSEARCH_SERVICE_NAME}

ARG LOGGER_LEVEL
ENV LOGGER_LEVEL=${LOGGER_LEVEL}

ARG GET_REMOTE_METADATA
ENV GET_REMOTE_METADATA=${GET_REMOTE_METADATA}

ARG GET_GITHUB_DATA
ENV GET_GITHUB_DATA=${GET_GITHUB_DATA}

ARG REMOTE_METADATA_LOCATION
ENV REMOTE_METADATA_LOCATION=${REMOTE_METADATA_LOCATION}

ARG GITHUB_API_KEY
ENV GITHUB_API_KEY=${GITHUB_API_KEY}

ARG ES_URI
ENV ES_URI=${ES_URI}

WORKDIR /usr/src/app
VOLUME "/usr/src/app"

COPY package*.json ./

RUN npm install

CMD [ "npm", "start" ]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ Before running any of the commands included in the package.json file there are s

#### Docker

To be added soon.
A docker-compose file has been added for convience. To run a dockerized version of the harvester, the standard `npm install` must be ran first; the files are copied into the container from the host.
Then, running `docker-compose up` will start the container.

This `docker-compose` file includes an elasticsearch configuration running on port 9200.

### Configuring

Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '2.4'
services:
harvester:
build: .
image: 'codegov/code-gov-harvester:latest'
container_name: 'code-gov-harvester'
env_file:
- ./.env
depends_on:
- elasticsearch
volumes:
- .:/usr/src/app
command: ["npm", "start"]
networks:
- esnet

elasticsearch:
image: "docker.elastic.co/elasticsearch/elasticsearch:5.6.9"
environment:
- xpack.security.enabled=false
ports:
- "9200:9200"
- "9300:9300"
container_name: 'code-gov-data'
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
interval: 30s
timeout: 30s
retries: 3
networks:
- esnet

networks:
esnet:
driver: bridge
6 changes: 3 additions & 3 deletions manifest.yml → manifest.yml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
applications:
- name: code-gov-harvester
- name: code-gov-harvester-v1.0.0
memory: 200M
instances: 1
disk_quota: 200M
Expand All @@ -11,8 +11,8 @@ applications:
CF_STAGING_TIMEOUT: 15
CF_STARTUP_TIMEOUT: 15
LOGGER_LEVEL: info
GITHUB_TOKEN: not-a-token
GITHUB_AUTH_TYPE: token
GITHUB_TOKEN: NOT_A_TOKEN
GET_REMOTE_METADATA: true
REMOTE_METADATA_LOCATION: https://raw.githubusercontent.com/GSA/code-gov-data/master/agency_metadata.json
GET_GITHUB_DATA: true
Expand All @@ -35,4 +35,4 @@ applications:
services:
- code_gov_elasticsearch
stack: cflinuxfs3
command: npm start
command: npm start
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "code-gov-harvester",
"version": "0.0.3",
"version": "1.0.3",
"description": "Code.gov code.json harvester and data manipulation tool",
"scripts": {
"debug": "node --inspect ./scripts/index/index.js",
Expand Down