Skip to content

Commit

Permalink
Some general enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
nihey committed Apr 4, 2019
1 parent f17c9ae commit ae416db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ FROM node:10

WORKDIR /var/www/

COPY . .
COPY package-lock.json package-lock.json
COPY package.json package.json
RUN npm ci --only=production

COPY . .

EXPOSE 7000

CMD [ "npm", "run", "serve-production" ]
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ reload:
docker-compose up -d

build-db:
docker-compose run -e NODE_ENV=production bovespa npm run build
docker-compose exec -e NODE_ENV=production bovespa npm run build

update-db:
docker-compose exec -e NODE_ENV=production bovespa node bin/build.js --update

remote-build-db:
ssh maridia "cd /var/www/bovespa && make build-db"

remote-update-db:
ssh maridia "cd /var/www/bovespa && make update-db"

deploy:
rsync -azv . maridia:/var/www/bovespa --exclude node_modules \
--exclude .git --exclude _downloaded
Expand Down
2 changes: 1 addition & 1 deletion bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function main() {
let set = new Set();

if (update) {
set = await util.get.filled();
set = await util.get.filled(moment({y: year}).startOf("year"));
}

await parse(year, data => {
Expand Down

0 comments on commit ae416db

Please sign in to comment.