forked from cronicle-edge/cronicle-edge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
776c195
commit 68da43d
Showing
4 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# build: docker build -t cronicle:pwsh -f DockerfileMultistage --build-arg branch=main --build-arg echo=1 . | ||
# multistage build example | ||
|
||
FROM node:14-alpine3.12 AS BASE | ||
|
||
WORKDIR /opt/cronicle | ||
RUN apk add git && git clone https://github.com/cronicle-edge/cronicle-edge.git /opt/cronicle | ||
ARG branch=main | ||
RUN git checkout ${branch} | ||
RUN npm audit fix --force; npm install | ||
|
||
|
||
# ------ main image ----------------------------- # | ||
|
||
FROM mcr.microsoft.com/powershell:alpine-3.12 | ||
RUN apk add --no-cache nodejs-current git tini util-linux bash openssl procps coreutils curl acl jq | ||
# required: all: tini; alpine: util-linux procps coreutils | ||
|
||
# optional lolcat for tty/color debugging | ||
RUN apk add lolcat --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing | ||
|
||
# optional java 15, for java 11 just use "apk add openjdk11" | ||
# RUN apk add openjdk15-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing | ||
# ENV JAVA_HOME=/usr/lib/jvm/java-15-openjdk | ||
# ENV PATH="$JAVA_HOME/bin:${PATH}" | ||
|
||
# optional PySpark | ||
# RUN apk add python3 gcompat | ||
# RUN pip3 install pyspark | ||
# ENV SPARK_CLASSPATH=/jars/* | ||
# python version, might change (e.g. to 3.9) | ||
# ENV PYSPARK_PYTHON=python3.8 | ||
|
||
# optional mc s3 client (+20MB) | ||
# RUN wget -O /usr/bin/mc http://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x /usr/bin/mc | ||
|
||
# optional kafkacat | ||
# RUN apk add kafkacat --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community | ||
# extra deps if using kerberos: apk add krb5 cyrus-sasl cyrus-sasl-gssapiv2 | ||
|
||
# optional - set up custom CA cert | ||
# COPY myCA.cer /usr/local/share/ca-certificates/myCA.crt | ||
# RUN apk add --no-cache ca-certificates | ||
# RUN update-ca-certificates | ||
# ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/myCA.crt | ||
|
||
ENV CRONICLE_foreground=1 | ||
ENV CRONICLE_echo=1 | ||
ENV TZ=America/New_York | ||
ENV EDITOR=nvim | ||
|
||
ENV PATH "/opt/cronicle/bin:${PATH}" | ||
|
||
# non root user for shell plugin | ||
ARG CRONICLE_UID=1007 | ||
ARG CRONICLE_GID=1099 | ||
RUN addgroup cronicle --gid $CRONICLE_GID && adduser -D -h /opt/cronicle -u $CRONICLE_UID -G cronicle cronicle | ||
|
||
WORKDIR /opt/cronicle | ||
ARG echo | ||
RUN echo $echo | ||
ARG branch=main | ||
RUN git clone https://github.com/cronicle-edge/cronicle-edge.git /opt/cronicle | ||
COPY --from=BASE /opt/cronicle/node_modules /opt/cronicle/node_modules | ||
RUN git checkout ${branch} | ||
#RUN npm audit fix --force; npm install | ||
RUN git pull && node bin/build dist | ||
|
||
|
||
# protect sensitive folders | ||
RUN mkdir -p /opt/cronicle/data /opt/cronicle/conf && chmod 0700 /opt/cronicle/data /opt/cronicle/conf | ||
|
||
ENTRYPOINT ["/sbin/tini", "--"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters