2021-01-02 16:03:11 +00:00
|
|
|
ARG IMAGESUFFIX
|
|
|
|
|
|
|
|
FROM --platform=$BUILDPLATFORM node:lts${IMAGESUFFIX} AS build-node
|
2022-07-15 19:45:18 +00:00
|
|
|
WORKDIR /app/ASF-ui
|
2020-04-08 17:32:53 +00:00
|
|
|
COPY ASF-ui .
|
2022-07-15 19:45:18 +00:00
|
|
|
COPY .git/modules/ASF-ui /app/.git/modules/ASF-ui
|
2024-04-24 18:27:22 +00:00
|
|
|
|
|
|
|
RUN <<EOF
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
echo "node: $(node --version)"
|
|
|
|
echo "npm: $(npm --version)"
|
|
|
|
|
|
|
|
npm ci --no-progress
|
2021-05-20 21:36:25 +00:00
|
|
|
npm run deploy --no-progress
|
2024-04-24 18:27:22 +00:00
|
|
|
EOF
|
2020-04-08 17:32:53 +00:00
|
|
|
|
2023-11-14 18:12:33 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0${IMAGESUFFIX} AS build-dotnet
|
2021-08-01 11:11:51 +00:00
|
|
|
ARG CONFIGURATION=Release
|
2021-01-02 13:49:03 +00:00
|
|
|
ARG TARGETARCH
|
|
|
|
ARG TARGETOS
|
2024-06-24 22:32:15 +00:00
|
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT=true
|
|
|
|
ENV DOTNET_NOLOGO=true
|
|
|
|
ENV PLUGINS_BUNDLED=ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
|
2020-04-08 17:32:53 +00:00
|
|
|
WORKDIR /app
|
2022-07-15 19:45:18 +00:00
|
|
|
COPY --from=build-node /app/ASF-ui/dist ASF-ui/dist
|
2020-04-08 17:32:53 +00:00
|
|
|
COPY ArchiSteamFarm ArchiSteamFarm
|
2022-12-15 17:46:37 +00:00
|
|
|
COPY ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.ItemsMatcher
|
2023-02-09 23:37:26 +00:00
|
|
|
COPY ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.MobileAuthenticator
|
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
|
2021-05-06 15:20:47 +00:00
|
|
|
COPY .editorconfig .editorconfig
|
2020-05-24 09:03:44 +00:00
|
|
|
COPY Directory.Build.props Directory.Build.props
|
2021-05-02 12:56:30 +00:00
|
|
|
COPY Directory.Packages.props Directory.Packages.props
|
2022-03-16 15:41:08 +00:00
|
|
|
COPY LICENSE.txt LICENSE.txt
|
2024-04-24 18:27:22 +00:00
|
|
|
|
2024-05-29 12:28:18 +00:00
|
|
|
RUN --mount=type=secret,id=ASF_PRIVATE_SNK --mount=type=secret,id=STEAM_TOKEN_DUMPER_TOKEN <<EOF
|
2024-04-24 18:27:22 +00:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
dotnet --info
|
|
|
|
|
|
|
|
case "$TARGETOS" in
|
|
|
|
"linux") ;;
|
|
|
|
*) echo "ERROR: Unsupported OS: ${TARGETOS}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$TARGETARCH" in
|
|
|
|
"amd64") asf_variant="${TARGETOS}-x64" ;;
|
|
|
|
"arm") asf_variant="${TARGETOS}-${TARGETARCH}" ;;
|
|
|
|
"arm64") asf_variant="${TARGETOS}-${TARGETARCH}" ;;
|
|
|
|
*) echo "ERROR: Unsupported CPU architecture: ${TARGETARCH}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
2024-05-29 12:28:18 +00:00
|
|
|
if [ -f "/run/secrets/ASF_PRIVATE_SNK" ]; then
|
|
|
|
base64 -d "/run/secrets/ASF_PRIVATE_SNK" > "resources/ArchiSteamFarm.snk"
|
|
|
|
else
|
|
|
|
echo "WARN: No ASF_PRIVATE_SNK provided!"
|
|
|
|
fi
|
|
|
|
|
2024-04-24 18:27:22 +00:00
|
|
|
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" "-p:ASFVariant=${asf_variant}" -p:ContinuousIntegrationBuild=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r "$asf_variant" --nologo --self-contained
|
|
|
|
|
|
|
|
if [ -f "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN" ]; then
|
|
|
|
STEAM_TOKEN_DUMPER_TOKEN="$(cat "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN")"
|
|
|
|
|
|
|
|
if [ -n "STEAM_TOKEN_DUMPER_TOKEN" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then
|
|
|
|
sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"
|
|
|
|
else
|
|
|
|
echo "WARN: STEAM_TOKEN_DUMPER_TOKEN not applied!"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "WARN: No STEAM_TOKEN_DUMPER_TOKEN provided!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
for plugin in $PLUGINS_BUNDLED; do
|
|
|
|
dotnet publish "$plugin" -c "$CONFIGURATION" -o "out/plugins/$plugin" "-p:ASFVariant=${asf_variant}" -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo
|
2024-03-26 16:12:50 +00:00
|
|
|
done
|
2024-04-24 18:27:22 +00:00
|
|
|
EOF
|
2020-04-08 17:32:53 +00:00
|
|
|
|
2023-11-14 18:12:33 +00:00
|
|
|
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:8.0${IMAGESUFFIX} AS runtime
|
2024-06-24 22:32:15 +00:00
|
|
|
ENV ASF_PATH=/app
|
|
|
|
ENV ASF_USER=asf
|
2020-04-08 17:32:53 +00:00
|
|
|
ENV ASPNETCORE_URLS=
|
2024-06-24 22:32:15 +00:00
|
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT=true
|
|
|
|
ENV DOTNET_NOLOGO=true
|
2021-01-02 17:33:16 +00:00
|
|
|
|
|
|
|
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>" \
|
|
|
|
org.opencontainers.image.authors="JustArchi <JustArchi@JustArchi.net>" \
|
|
|
|
org.opencontainers.image.url="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Docker" \
|
|
|
|
org.opencontainers.image.documentation="https://github.com/JustArchiNET/ArchiSteamFarm/wiki" \
|
|
|
|
org.opencontainers.image.source="https://github.com/JustArchiNET/ArchiSteamFarm" \
|
|
|
|
org.opencontainers.image.vendor="JustArchiNET" \
|
|
|
|
org.opencontainers.image.licenses="Apache-2.0" \
|
|
|
|
org.opencontainers.image.title="ArchiSteamFarm" \
|
|
|
|
org.opencontainers.image.description="C# application with primary purpose of idling Steam cards from multiple accounts simultaneously"
|
|
|
|
|
2020-04-08 17:32:53 +00:00
|
|
|
EXPOSE 1242
|
2024-02-05 15:26:54 +00:00
|
|
|
COPY --from=build-dotnet /app/out /asf
|
2021-10-17 14:19:07 +00:00
|
|
|
|
2024-04-24 18:27:22 +00:00
|
|
|
RUN <<EOF
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
mkdir -p "$ASF_PATH"
|
|
|
|
|
|
|
|
groupadd -r -g 1000 "$ASF_USER"
|
|
|
|
useradd -r -d "$ASF_PATH" -g 1000 -u 1000 "$ASF_USER"
|
|
|
|
chown -hR "${ASF_USER}:${ASF_USER}" "$ASF_PATH" /asf
|
|
|
|
|
2024-02-05 15:26:54 +00:00
|
|
|
ln -s /asf/ArchiSteamFarm-Service.sh /usr/bin/ArchiSteamFarm
|
2024-04-24 18:27:22 +00:00
|
|
|
EOF
|
2021-10-17 14:19:07 +00:00
|
|
|
|
2024-04-24 18:27:22 +00:00
|
|
|
WORKDIR /app
|
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", "ArchiSteamFarm"]
|
2024-04-17 10:02:26 +00:00
|
|
|
ENTRYPOINT ["ArchiSteamFarm", "--no-restart", "--system-required"]
|