<commit_before>FROM golang:alpine

ARG TZ=America/Chicago

# add user and set TZ
RUN \
 apk add --update tzdata && \
 adduser -s /bin/bash -D -u 1001 secrets && \
 mkdir -p /srv && chown -R secrets:secrets /srv && \
 cp /usr/share/zoneinfo/$TZ /etc/localtime && \
 echo $TZ > /etc/timezone && \
 rm -rf /var/cache/apk/*

# build service
ADD app /go/src/github.com/umputun/secrets/app
RUN \
 apk add --update --no-progress git && \
 cd /go/src/github.com/umputun/secrets/app && \
 go get -v && \
 go build -ldflags "-X main.revision=$(date +%Y%m%d-%H%M%S)" -o /srv/secrets && \
 apk del git && rm -rf /go/src/* && rm -rf /var/cache/apk/*

# build webapp
ADD webapp /srv/webapp
RUN \
 apk --update --no-progress add nodejs-lts git python make g++ && \
 cd /srv/webapp && \
 npm i --production && npm run build && \
 mv -fv /srv/webapp/public/ /srv/docroot && \
 rm -rf  /srv/webapp && \
 apk del nodejs-lts git python make g++ && rm -rf /var/cache/apk/*

RUN \
 echo "#!/bin/sh" > /srv/exec.sh && \
 echo "tail -F /srv/logs/secrets.log &" /srv/exec.sh && \
 echo "/srv/secrets >> /srv/logs/secrets.log" >> /srv/exec.sh && \
 chmod +x /srv/exec.sh


EXPOSE 8080
USER secrets
WORKDIR /srv
VOLUME ["/srv/docroot", "/srv/logs"]
ENTRYPOINT ["/srv/exec.sh"]<commit_msg>use nodejs-current & nodejs-current-npm instead of nodejs-lts<commit_after>FROM golang:alpine

ARG TZ=America/Chicago

# add user and set TZ
RUN \
 apk add --update tzdata && \
 adduser -s /bin/bash -D -u 1001 secrets && \
 mkdir -p /srv && chown -R secrets:secrets /srv && \
 cp /usr/share/zoneinfo/$TZ /etc/localtime && \
 echo $TZ > /etc/timezone && \
 rm -rf /var/cache/apk/*

# build service
ADD app /go/src/github.com/umputun/secrets/app
RUN \
 apk add --update --no-progress git && \
 cd /go/src/github.com/umputun/secrets/app && \
 go get -v && \
 go build -ldflags "-X main.revision=$(date +%Y%m%d-%H%M%S)" -o /srv/secrets && \
 apk del git && rm -rf /go/src/* && rm -rf /var/cache/apk/*

# build webapp
ADD webapp /srv/webapp
RUN \
 apk --update --no-progress add nodejs-current nodejs-current-npm git python make g++ && \
 cd /srv/webapp && \
 npm i --production && npm run build && \
 mv -fv /srv/webapp/public/ /srv/docroot && \
 rm -rf  /srv/webapp && \
 apk del nodejs-current nodejs-current-npm git python make g++ && rm -rf /var/cache/apk/*

RUN \
 echo "#!/bin/sh" > /srv/exec.sh && \
 echo "tail -F /srv/logs/secrets.log &" /srv/exec.sh && \
 echo "/srv/secrets >> /srv/logs/secrets.log" >> /srv/exec.sh && \
 chmod +x /srv/exec.sh


EXPOSE 8080
USER secrets
WORKDIR /srv
VOLUME ["/srv/docroot", "/srv/logs"]
ENTRYPOINT ["/srv/exec.sh"]
{'fraction_non_alphanumeric': 0.1915137614678899, 'fraction_numerical': 0.0061162079510703364, 'mean_word_length': 2.5605442176870747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5159550', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1060, 'n_words': 280}