diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eac66a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bullseye-slim + +ENV CRONICLE_foreground=1 +ENV CRONICLE_echo=1 +ENV CRONICLE_color=1 +ENV EDITOR=vi +ENV MODE=master + +RUN apt update && apt install -y tini curl git + +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - + +RUN apt install nodejs + +RUN git clone https://github.com/cronicle-edge/cronicle-edge.git /opt/cronicle + +WORKDIR /opt/cronicle + +RUN npm install + +RUN node bin/build dist + +COPY run.sh / + +RUN chmod +x /run.sh + +#RUN ln -sf /dev/stdout /opt/cronicle/logs/Cronicle.log + +EXPOSE 3012 + +ENTRYPOINT ["/usr/bin/tini", "--"] + +CMD [ "/run.sh" ] \ No newline at end of file diff --git a/README.md b/README.md index a122e4c..ce010c0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,41 @@ -# cronicle-docker +# Cronicle Docker -Dockerised Cronicle, based on the Cronicle-Edge fork \ No newline at end of file +⚠️ This container is being actively developed and is not ready for use! ⚠️ + +Dockerised Cronicle, based on the [Cronicle-Edge](https://github.com/cronicle-edge/cronicle-edge) fork. + +Can function in both the **master** and **worker** role. + +## Running +### Docker CLI +``` +docker run -d --name cronicle \ + -p 3012:3012 \ + -e MODE=master \ + git.mrmeeb.stream/mrmeeb/cronicle:latest +``` + +### Docker Compose + +``` +version: '3' +services: + cronicle: + container_name: cronicle + image: git.mrmeeb.stream/mrmeeb/cronicle:latest + restart: unless-stopped + ports: + - 3012:3012 + environment: + - MODE=master +``` + +## Ports +|Port |Purpose | +|-----|--------- | +|3012 |WebUI | + +## Environment Variables +|Variable|Options|Default|Description| +|--------|-------|-------|-------| +|MODE |master, worker|master|Determines what mode Cronicle runs in \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..0eab704 --- /dev/null +++ b/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +echo $MODE + +if [ $MODE == "master" ] +then + echo "Cronicle is running in 'master' mode" +elif [ $MODE == "worker" ] +then + echo "Cronicle is running in 'worker' mode" +else + echo "This is not a recognised mode. Accepted options are 'master' and 'worker'" +fi + +#/opt/cronicle/bin/control.sh setup + +#exec node /opt/cronicle/lib/main.js --color 1 \ No newline at end of file