Skip to content

Commit

Permalink
Add Docker suport
Browse files Browse the repository at this point in the history
Signed-off-by: Dowideit, Sven (O&A, St. Lucia) <[email protected]>
  • Loading branch information
Dowideit, Sven (O&A, St. Lucia) committed Aug 10, 2018
1 parent de0a77b commit c812d46
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:alpine

RUN apk --no-cache add jq

WORKDIR /opt/Cronicle

COPY . /opt/Cronicle/
RUN npm install
RUN node bin/build.js dist

CMD ["/opt/Cronicle/bin/control.sh", "setup_and_start"]

EXPOSE 3012
VOLUME ["/opt/Cronicle/logs", "/opt/Cronicle/data"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

IMAGE=cronicle

run: build
docker run --rm -it \
-p 3012:3012 \
$(IMAGE)

build:
docker build -t $(IMAGE) .
7 changes: 7 additions & 0 deletions bin/control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ do
node $HOMEDIR/bin/storage-cli.js setup
exit
;;
setup_and_start)
# one entrypoint that initialises the filesystem only if needed.
if [ ! -e $HOMEDIR/data/_temp ]; then
$HOMEDIR/bin/control.sh setup
fi
exec $HOMEDIR/bin/debug.sh start
;;
maint)
node $HOMEDIR/bin/storage-cli.js maint $2
exit
Expand Down

0 comments on commit c812d46

Please sign in to comment.