Skip to content

Commit

Permalink
feat: load whoishiring data into the database
Browse files Browse the repository at this point in the history
  • Loading branch information
jerroydmoore committed Dec 30, 2019
1 parent c5585d4 commit 558babb
Show file tree
Hide file tree
Showing 22 changed files with 1,296 additions and 183 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"node": true,
"jest/globals": true
},
"ignorePatterns": [ "node_modules/"],
"rules": {
"import/no-commonjs": 0,
"import/no-nodejs-modules": 0,
"indent": [ "error", 2, { "SwitchCase": 1 } ],
"no-console": 1,
"no-console": 0,
"no-process-exit": 0,
"no-unused-expressions": 0,
"no-unused-vars": ["error", { "argsIgnorePattern": "next" }],
Expand Down
2 changes: 2 additions & 0 deletions container-populate-hn-data/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
__tests__
28 changes: 28 additions & 0 deletions container-populate-hn-data/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This stage installs our modules
FROM mhart/alpine-node:12

ENV container=docker NODE_ENV=production
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci --prod

# Then we copy over the modules from above onto a `slim` image
FROM mhart/alpine-node:slim-12

COPY wait-for-it.sh .
RUN chmod +x ./wait-for-it.sh

# If possible, run your container using `docker run --init`
# Otherwise, you can use `tini`:
RUN apk add --no-cache tini bash \
&& addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node

ENTRYPOINT ["/sbin/tini", "--"]
USER node

COPY --from=0 /app .
COPY ./src ./src/

CMD ./wait-for-it.sh $PGHOST:$PGPORT -- node ./src/index.js
File renamed without changes.
277 changes: 277 additions & 0 deletions container-populate-hn-data/package-lock.json

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

23 changes: 23 additions & 0 deletions container-populate-hn-data/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@whoishiring.work/populate-hn-data",
"version": "1.0.0",
"private": true,
"description": "Populates whoishiring data from hacker news into the database",
"license": "MIT",
"repository": "https://github.com/jerroydmoore/whoishiring.work.git",
"type": "commonjs",
"engines": {
"node": ">=12.13.0"
},
"scripts": {
"start": "node src/index.js"
},
"dependencies": {
"debug": "^4.1.1",
"node-fetch": "^2.6.0",
"pg": "^7.16.1",
"pg-hstore": "^2.3.3",
"sequelize": "^5.21.3"
},
"devDependencies": {}
}
Loading

0 comments on commit 558babb

Please sign in to comment.