3 FROM --platform=$BUILDPLATFORM node:lts${IMAGESUFFIX} AS build-node
6 COPY .git/modules/ASF-ui /app/.git/modules/ASF-ui
11 echo "node: $(node --version)"
12 echo "npm: $(npm --version)"
15 npm run deploy --no-progress
18 FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0${IMAGESUFFIX} AS build-dotnet
19 ARG CONFIGURATION=Release
22 ENV DOTNET_CLI_TELEMETRY_OPTOUT=true
23 ENV DOTNET_NOLOGO=true
24 ENV PLUGINS_BUNDLED="ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.SteamTokenDumper"
26 COPY --from=build-node /app/ASF-ui/dist ASF-ui/dist
27 COPY ArchiSteamFarm ArchiSteamFarm
28 COPY ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.ItemsMatcher
29 COPY ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.MobileAuthenticator
30 COPY ArchiSteamFarm.OfficialPlugins.SteamTokenDumper ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
31 COPY resources resources
32 COPY .editorconfig .editorconfig
33 COPY Directory.Build.props Directory.Build.props
34 COPY Directory.Packages.props Directory.Packages.props
35 COPY LICENSE.txt LICENSE.txt
37 RUN --mount=type=secret,id=ASF_PRIVATE_SNK --mount=type=secret,id=STEAM_TOKEN_DUMPER_TOKEN <<EOF
44 *) echo "ERROR: Unsupported OS: ${TARGETOS}"; exit 1 ;;
48 "amd64") asf_variant="${TARGETOS}-x64" ;;
49 "arm") asf_variant="${TARGETOS}-${TARGETARCH}" ;;
50 "arm64") asf_variant="${TARGETOS}-${TARGETARCH}" ;;
51 *) echo "ERROR: Unsupported CPU architecture: ${TARGETARCH}"; exit 1 ;;
54 if [ -f "/run/secrets/ASF_PRIVATE_SNK" ]; then
55 base64 -d "/run/secrets/ASF_PRIVATE_SNK" > "resources/ArchiSteamFarm.snk"
57 echo "WARN: No ASF_PRIVATE_SNK provided!"
60 dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo --no-self-contained
62 if [ -f "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN" ]; then
63 STEAM_TOKEN_DUMPER_TOKEN="$(cat "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN")"
65 if [ -n "$STEAM_TOKEN_DUMPER_TOKEN" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then
66 sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"
68 echo "WARN: STEAM_TOKEN_DUMPER_TOKEN not applied!"
71 echo "WARN: No STEAM_TOKEN_DUMPER_TOKEN provided!"
74 for plugin in $PLUGINS_BUNDLED; do
75 dotnet publish "$plugin" -c "$CONFIGURATION" -o "out/plugins/$plugin" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo
79 FROM mcr.microsoft.com/dotnet/aspnet:9.0${IMAGESUFFIX} AS runtime
83 ENV DOTNET_CLI_TELEMETRY_OPTOUT=true
84 ENV DOTNET_NOLOGO=true
86 LABEL maintainer="JustArchi <JustArchi@JustArchi.net>" \
87 org.opencontainers.image.authors="JustArchi <JustArchi@JustArchi.net>" \
88 org.opencontainers.image.url="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Docker" \
89 org.opencontainers.image.documentation="https://github.com/JustArchiNET/ArchiSteamFarm/wiki" \
90 org.opencontainers.image.source="https://github.com/JustArchiNET/ArchiSteamFarm" \
91 org.opencontainers.image.vendor="JustArchiNET" \
92 org.opencontainers.image.licenses="Apache-2.0" \
93 org.opencontainers.image.title="ArchiSteamFarm" \
94 org.opencontainers.image.description="C# application with primary purpose of idling Steam cards from multiple accounts simultaneously"
97 COPY --from=build-dotnet /app/out /asf
104 groupadd -r -g 1000 "$ASF_USER"
105 useradd -r -d "$ASF_PATH" -g 1000 -u 1000 "$ASF_USER"
106 chown -hR "${ASF_USER}:${ASF_USER}" "$ASF_PATH" /asf
108 ln -s /asf/ArchiSteamFarm.sh /usr/bin/ArchiSteamFarm
112 VOLUME ["/app/config", "/app/logs"]
113 HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
114 ENTRYPOINT ["ArchiSteamFarm", "--no-restart", "--system-required"]