<commit_before>FROM openjdk:8-jre-alpine

# Add studio group and user
RUN addgroup -g 9091 studio \
    && adduser -G studio -h /home/studio -D -u 9091 studio

# gosu for easy step down from root
ENV GOSU_VERSION 1.9
RUN set -x \
    && apk add --no-cache --virtual .gosu-deps \
        dpkg \
        gnupg \
        openssl \
    && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
    && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
    && export GNUPGHOME="$(mktemp -d)" \
    && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys <KEY> \
    && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true \
    && apk del .gosu-deps

# Use this to change the Studio version we're building an image for
ARG STUDIO_VERSION=1.0.2

# Download, verify, and unpack Studio
RUN set -x \
    && apk add --no-cache --virtual .studio-deps \
        openssl \
    && wget "https://downloads.datastax.com/datastax-studio/datastax-studio-$STUDIO_VERSION.tar.gz" \
    && wget "https://downloads.datastax.com/datastax-studio/datastax-studio-$STUDIO_VERSION.tar.gz.md5" \
    && md5sum -c *.md5 \
    && mkdir /opt \
    && tar -xzvf "datastax-studio-$STUDIO_VERSION.tar.gz" -C /opt \
    && mv "/opt/datastax-studio-$STUDIO_VERSION" /opt/studio \
    && chown -R studio:studio /opt/studio \
    && rm "datastax-studio-$STUDIO_VERSION.tar.gz" "datastax-studio-$STUDIO_VERSION.tar.gz.md5" \
    && apk del .studio-deps

# Create directory for user data (this is the default location where connections and notebooks are saved)
RUN mkdir /opt/studio/userdata \
    && chown -R studio:studio /opt/studio/userdata

# Volume for configuration files and user data
VOLUME [ "/opt/studio/conf", "/opt/studio/userdata" ]

# Expose the web UI port for studio
EXPOSE 9091<commit_msg>Modify server script to account for us being on alpine<commit_after>FROM openjdk:8-jre-alpine

# Add studio group and user
RUN addgroup -g 9091 studio \
    && adduser -G studio -h /home/studio -D -u 9091 studio

# gosu for easy step down from root
ENV GOSU_VERSION 1.9
RUN set -x \
    && apk add --no-cache --virtual .gosu-deps \
        dpkg \
        gnupg \
        openssl \
    && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
    && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
    && export GNUPGHOME="$(mktemp -d)" \
    && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys <KEY>0F88E364FD4036A9C25BF357DD4 \
    && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true \
    && apk del .gosu-deps

# Use this to change the Studio version we're building an image for
ARG STUDIO_VERSION=1.0.2

# Download, verify, and unpack Studio
RUN set -x \
    && apk add --no-cache --virtual .studio-deps \
        openssl \
    && wget "https://downloads.datastax.com/datastax-studio/datastax-studio-$STUDIO_VERSION.tar.gz" \
    && wget "https://downloads.datastax.com/datastax-studio/datastax-studio-$STUDIO_VERSION.tar.gz.md5" \
    && md5sum -c *.md5 \
    && mkdir /opt \
    && tar -xzvf "datastax-studio-$STUDIO_VERSION.tar.gz" -C /opt \
    && mv "/opt/datastax-studio-$STUDIO_VERSION" /opt/studio \
    && chown -R studio:studio /opt/studio \
    && rm "datastax-studio-$STUDIO_VERSION.tar.gz" "datastax-studio-$STUDIO_VERSION.tar.gz.md5" \
    && apk del .studio-deps

# Right now, the server.sh expects bash (which we don't have) so replace that
RUN sed -i 's_bin/bash_bin/sh_' /opt/studio/bin/server.sh

# Create directory for user data (this is the default location where connections and notebooks are saved)
RUN mkdir /opt/studio/userdata \
    && chown -R studio:studio /opt/studio/userdata

# Volume for configuration files and user data
VOLUME [ "/opt/studio/conf", "/opt/studio/userdata" ]

# Expose the web UI port for studio
EXPOSE 9091
{'fraction_non_alphanumeric': 0.1493284771226952, 'fraction_numerical': 0.013885727293421352, 'mean_word_length': 2.765209940017138, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6829138', 'n_tokens_mistral': 1726, 'n_tokens_neox': 1657, 'n_words': 384}