<commit_before>FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

# install node and npm
# replace shell with bash so we can source files
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | sh

ENV NODE_VERSION 14.18.1

ENV NVM_DIR /root/.nvm
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

RUN . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
	&& nvm use $NODE_VERSION \
	&& apt-get update \
	&& apt-get install -y \
		dos2unix \
	&& rm -rf /var/lib/apt/lists/* \
	&& npm install -g npm

# Build web control panel
WORKDIR /repo/build

COPY build/Version.props Version.props
COPY build/ControlPanelVersion.props ControlPanelVersion.props

WORKDIR /repo/src/Tgstation.Server.Host

COPY src/Tgstation.Server.Host/Tgstation.Server.Host.csproj ./

# I cant figure out how to run npm as non root so eh
RUN npm set unsafe-perm true
RUN dotnet msbuild -target:NpmBuild
RUN npm set unsafe-perm false

WORKDIR /repo

# Restore nuget packages
COPY tgstation-server.sln ./

COPY src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj src/Tgstation.Server.Host.Console/
COPY src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj src/Tgstation.Server.Host.Watchdog/
COPY src/Tgstation.Server.Api/Tgstation.Server.Api.csproj src/Tgstation.Server.Api/

RUN dotnet restore -nowarn:MSB3202,nu1503 -p:RestoreUseSkipNonexistentTargets=false

# Final copy for building
COPY . .

#run dos2unix on tgs.docker.sh so we can build without issue on windows
RUN dos2unix build/tgs.docker.sh<commit_msg>Add yarn to dockerfile<commit_after>FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

# install node and npm
# replace shell with bash so we can source files
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | sh

ENV NODE_VERSION 14.18.1

ENV NVM_DIR /root/.nvm
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

RUN . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
	&& nvm use $NODE_VERSION \
	&& apt-get update \
	&& apt-get install -y \
		dos2unix \
	&& rm -rf /var/lib/apt/lists/* \
	&& npm install -g npm

# Build web control panel
WORKDIR /repo/build

COPY build/Version.props Version.props
COPY build/ControlPanelVersion.props ControlPanelVersion.props

WORKDIR /repo/src/Tgstation.Server.Host

COPY src/Tgstation.Server.Host/Tgstation.Server.Host.csproj ./

# I cant figure out how to run npm as non root so eh
RUN npm set unsafe-perm true
RUN dotnet msbuild -target:NpmBuild
RUN npm set unsafe-perm false

#Install yarn globally for webpanel
RUN npm install -g yarn

WORKDIR /repo

# Restore nuget packages
COPY tgstation-server.sln ./

COPY src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj src/Tgstation.Server.Host.Console/
COPY src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj src/Tgstation.Server.Host.Watchdog/
COPY src/Tgstation.Server.Api/Tgstation.Server.Api.csproj src/Tgstation.Server.Api/

RUN dotnet restore -nowarn:MSB3202,nu1503 -p:RestoreUseSkipNonexistentTargets=false

# Final copy for building
COPY . .

#run dos2unix on tgs.docker.sh so we can build without issue on windows
RUN dos2unix build/tgs.docker.sh
{'fraction_non_alphanumeric': 0.1039039039039039, 'fraction_numerical': 0.013213213213213212, 'mean_word_length': 4.046969696969697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7009854', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1158, 'n_words': 292}