Skip to content
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
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:14.12

RUN apt-get update
RUN npm install http-server -g
RUN git clone https://github.com/wolfgang42/paper-hn.git

WORKDIR /paper-hn
RUN yarn install

COPY /scripts/main_loop.sh .

CMD /paper-hn/main_loop.sh
16 changes: 16 additions & 0 deletions scripts/main_loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash


REFRESH_INTERVAL=${REFRESH_INTERVAL:-300}
cd /paper-hn

http-server . >http.log 2>&1 &
echo Starting up... > index.html

while true
do
node --experimental-modules ./bin/generate-html.mjs
sleep $REFRESH_INTERVAL
rm cache/hn/*.json
done