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:8.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=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 dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo --no-self-contained
56 if [ -f "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN" ]; then
57 STEAM_TOKEN_DUMPER_TOKEN="$(cat "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN")"
59 if [ -n "$STEAM_TOKEN_DUMPER_TOKEN" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then
60 sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"
62 echo "WARN: STEAM_TOKEN_DUMPER_TOKEN not applied!"
65 echo "WARN: No STEAM_TOKEN_DUMPER_TOKEN provided!"
68 for plugin in $PLUGINS_BUNDLED; do
69 dotnet publish "$plugin" -c "$CONFIGURATION" -o "out/plugins/$plugin" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo
73 FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0${IMAGESUFFIX} AS runtime
77 ENV DOTNET_CLI_TELEMETRY_OPTOUT true
78 ENV DOTNET_NOLOGO true
80 LABEL maintainer="JustArchi <JustArchi@JustArchi.net>" \
81 org.opencontainers.image.authors="JustArchi <JustArchi@JustArchi.net>" \
82 org.opencontainers.image.url="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Docker" \
83 org.opencontainers.image.documentation="https://github.com/JustArchiNET/ArchiSteamFarm/wiki" \
84 org.opencontainers.image.source="https://github.com/JustArchiNET/ArchiSteamFarm" \
85 org.opencontainers.image.vendor="JustArchiNET" \
86 org.opencontainers.image.licenses="Apache-2.0" \
87 org.opencontainers.image.title="ArchiSteamFarm" \
88 org.opencontainers.image.description="C# application with primary purpose of idling Steam cards from multiple accounts simultaneously"
91 COPY --from=build-dotnet /app/out /asf
98 groupadd -r -g 1000 "$ASF_USER"
99 useradd -r -d "$ASF_PATH" -g 1000 -u 1000 "$ASF_USER"
100 chown -hR "${ASF_USER}:${ASF_USER}" "$ASF_PATH" /asf
102 ln -s /asf/ArchiSteamFarm.sh /usr/bin/ArchiSteamFarm
106 VOLUME ["/app/config", "/app/logs"]
107 HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
108 ENTRYPOINT ["ArchiSteamFarm", "--no-restart", "--system-required"]