<commit_before>FROM alpine:3.11
LABEL maintainer="<EMAIL>"

ENV APP_NAME ${APP_NAME}
ENV APP_ENV ${APP_ENV}
ENV APP_PATH /opt/app
ENV APP_LOG_PATH /data/app/log
ENV PATH .:$PATH
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
RUN apk add -U tzdata \
    curl \
    iputils \
    net-tools
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

RUN addgroup -S app && adduser -S app -G app
RUN mkdir -p ${APP_LOG_PATH} && chown -R app:app ${APP_LOG_PATH} \
    && mkdir -p ${APP_PATH} && chown -R app:app ${APP_PATH}
WORKDIR ${APP_PATH}
VOLUME ${APP_LOG_PATH}
USER app
RUN echo "PS1=$" >> ~/.bashrc

ONBUILD ARG APP_NAME
ONBUILD ENV APP_NAME ${APP_NAME}
ONBUILD COPY --from=builder ${APP_PATH}/app ${APP_PATH}/app
ONBUILD COPY --from=builder ${APP_PATH}/configs/${APP_NAME}/settings ${APP_PATH}/settings
EXPOSE 8080
CMD ["app"]
<commit_msg>use ARG set go-app APP_ENV<commit_after>FROM alpine:3.11
LABEL maintainer="<EMAIL>"

ENV APP_PATH /opt/app
ENV APP_LOG_PATH /data/app/log
ENV PATH .:$PATH
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
RUN apk add -U tzdata \
    curl \
    iputils \
    net-tools
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

RUN addgroup -S app && adduser -S app -G app
RUN mkdir -p ${APP_LOG_PATH} && chown -R app:app ${APP_LOG_PATH} \
    && mkdir -p ${APP_PATH} && chown -R app:app ${APP_PATH}
WORKDIR ${APP_PATH}
VOLUME ${APP_LOG_PATH}
USER app
RUN echo "PS1=$" >> ~/.bashrc

ONBUILD ARG APP_NAME=go-app
ONBUILD ARG APP_ENV=dev
ONBUILD ENV APP_NAME ${APP_NAME}
ONBUILD ENV APP_ENV ${APP_ENV}
ONBUILD COPY --from=builder ${APP_PATH}/app ${APP_PATH}/app
ONBUILD COPY --from=builder ${APP_PATH}/configs/${APP_NAME}/settings ${APP_PATH}/settings
EXPOSE 8080
CMD ["app"]

{'fraction_non_alphanumeric': 0.146218487394958, 'fraction_numerical': 0.008963585434173669, 'mean_word_length': 4.045197740112994, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3051281', 'n_tokens_mistral': 746, 'n_tokens_neox': 712, 'n_words': 189}