2020-06-24 17:34:39 +00:00
|
|
|
ARG DOTNET_ARCH=
|
|
|
|
|
2020-04-08 17:32:53 +00:00
|
|
|
FROM node:lts AS build-node
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ASF-ui .
|
|
|
|
RUN echo "node: $(node --version)" && \
|
|
|
|
echo "npm: $(npm --version)" && \
|
|
|
|
npm ci && \
|
|
|
|
npm run deploy
|
|
|
|
|
2020-11-10 22:22:57 +00:00
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-dotnet
|
2020-06-13 23:36:04 +00:00
|
|
|
ARG ASF_ARCH=x64
|
2020-06-13 15:05:26 +00:00
|
|
|
ARG STEAM_TOKEN_DUMPER_TOKEN
|
2020-04-08 17:32:53 +00:00
|
|
|
ENV CONFIGURATION Release
|
2020-05-09 23:13:54 +00:00
|
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
|
2020-09-28 19:46:17 +00:00
|
|
|
ENV DOTNET_NOLOGO 1
|
2020-11-10 22:22:57 +00:00
|
|
|
ENV NET_CORE_VERSION net5.0
|
2020-06-13 15:05:26 +00:00
|
|
|
ENV STEAM_TOKEN_DUMPER_NAME ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
|
2020-04-08 17:32:53 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build-node /app/dist ASF-ui/dist
|
|
|
|
COPY ArchiSteamFarm ArchiSteamFarm
|
2020-06-13 15:05:26 +00:00
|
|
|
COPY ArchiSteamFarm.OfficialPlugins.SteamTokenDumper ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
|
2020-05-04 22:14:36 +00:00
|
|
|
COPY resources resources
|
2020-05-24 09:03:44 +00:00
|
|
|
COPY Directory.Build.props Directory.Build.props
|
2020-04-08 17:32:53 +00:00
|
|
|
RUN dotnet --info && \
|
|
|
|
# TODO: Remove workaround for https://github.com/microsoft/msbuild/issues/3897 when it's no longer needed
|
|
|
|
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
|
|
|
|
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
|
2020-06-13 15:05:26 +00:00
|
|
|
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
|
2020-06-13 23:36:04 +00:00
|
|
|
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
|
|
|
|
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
|
|
|
|
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=docker -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
|
2020-06-13 15:05:26 +00:00
|
|
|
if [ -d "ArchiSteamFarm/overlay/generic" ]; then cp "ArchiSteamFarm/overlay/generic/"* "out/result"; fi && \
|
|
|
|
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
|
2020-04-08 17:32:53 +00:00
|
|
|
|
2020-11-10 22:22:57 +00:00
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim${DOTNET_ARCH} AS runtime
|
2020-04-08 17:32:53 +00:00
|
|
|
ENV ASPNETCORE_URLS=
|
2020-05-09 23:13:54 +00:00
|
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
|
2020-09-28 19:46:17 +00:00
|
|
|
ENV DOTNET_NOLOGO 1
|
2020-04-08 17:32:53 +00:00
|
|
|
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
|
|
|
|
EXPOSE 1242
|
|
|
|
WORKDIR /app
|
2020-06-13 15:05:26 +00:00
|
|
|
COPY --from=build-dotnet /app/out/result .
|
2020-06-13 23:51:50 +00:00
|
|
|
VOLUME ["/app/config", "/app/logs"]
|
2020-05-04 14:31:05 +00:00
|
|
|
HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
|
2020-04-08 17:32:53 +00:00
|
|
|
ENTRYPOINT ["./ArchiSteamFarm.sh", "--no-restart", "--process-required", "--system-required"]
|