ArchiSteamFarm/Dockerfile

90 lines
3.8 KiB
Docker
Raw Normal View History

2021-01-02 16:03:11 +00:00
ARG IMAGESUFFIX
FROM --platform=$BUILDPLATFORM node:lts${IMAGESUFFIX} AS build-node
WORKDIR /app/ASF-ui
2020-04-08 17:32:53 +00:00
COPY ASF-ui .
COPY .git/modules/ASF-ui /app/.git/modules/ASF-ui
RUN 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
2020-04-08 17:32:53 +00:00
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0${IMAGESUFFIX} AS build-dotnet
ARG CONFIGURATION=Release
ARG STEAM_TOKEN_DUMPER_TOKEN
ARG TARGETARCH
ARG TARGETOS
ENV DOTNET_CLI_TELEMETRY_OPTOUT true
ENV DOTNET_NOLOGO true
2024-03-25 23:36:04 +00:00
ENV PLUGINS_BUNDLED ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
2020-04-08 17:32:53 +00:00
WORKDIR /app
COPY --from=build-node /app/ASF-ui/dist ASF-ui/dist
2020-04-08 17:32:53 +00:00
COPY ArchiSteamFarm ArchiSteamFarm
COPY ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.ItemsMatcher
COPY ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.MobileAuthenticator
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
RUN 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; \
\
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo --no-self-contained; \
\
2022-12-19 21:50:25 +00:00
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"; \
fi; \
\
2024-03-25 23:36:04 +00:00
for plugin in $PLUGINS_BUNDLED; do \
Squashed commit of the following: commit a5dd19643edd71ba3bcf9d120cc0ef20c1904104 Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 03:43:50 2024 +0100 How about this one commit 7f44554a5433931339dc479a6101f942c5d5fb97 Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 03:14:04 2024 +0100 Here as well commit 8593cd169949dc5876c1a3c4e4561d2ca38d7350 Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 03:13:36 2024 +0100 Okay commit 9d17fee1f8f9bd3ae91f144761885d10e52b67ae Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 03:08:49 2024 +0100 Restore everything first commit 2835332dabf17a9dcdea3fc4f75e0c650add622c Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 03:00:33 2024 +0100 Ah right commit 85e2db40c8d6c184e5732724ea928486456767e4 Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 02:59:31 2024 +0100 And this? commit 974cffb61782a4dbc83dfd93a66a627a69d04fd9 Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 02:33:52 2024 +0100 Docker improvements commit 95f40803615f7056f59a522b068600dfbb87b4de Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 02:22:30 2024 +0100 Misc commit 0f5b526c603d5cfe0f29b4f4b8420d01f76161fc Author: Łukasz Domeradzki <JustArchi@JustArchi.net> Date: Tue Mar 26 02:09:42 2024 +0100 Make bundled plugins variant-specific Since we're including them as part of OS-specific builds, we can also limit their dependencies to those OSes exclusively. Might help cut some unnecessary dependencies.
2024-03-26 03:42:31 +00:00
dotnet publish "$plugin" -c "$CONFIGURATION" -o "out/plugins/$plugin" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo & \
done; \
\
wait
2020-04-08 17:32:53 +00:00
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0${IMAGESUFFIX} AS runtime
ENV ASF_PATH /app
2021-10-17 14:19:07 +00:00
ENV ASF_USER asf
2020-04-08 17:32:53 +00:00
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT true
ENV DOTNET_NOLOGO true
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
WORKDIR /app
COPY --from=build-dotnet /app/out /asf
2021-10-17 14:19:07 +00:00
RUN set -eu; \
groupadd -r -g 1000 asf; \
useradd -r -d /app -g 1000 -u 1000 asf; \
mkdir -p /app /asf; \
chown -hR asf:asf /app /asf; \
ln -s /asf/ArchiSteamFarm.sh /usr/bin/ArchiSteamFarm
2021-10-17 14:19:07 +00:00
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"]
ENTRYPOINT ["ArchiSteamFarm", "--no-restart", "--process-required", "--system-required"]