Skip to content

Instantly share code, notes, and snippets.

@mnixry
Last active May 12, 2024 08:54
Show Gist options
  • Save mnixry/bdc06cfc70c25e3b418ebca27c2ced32 to your computer and use it in GitHub Desktop.
Save mnixry/bdc06cfc70c25e3b418ebca27c2ced32 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
git clone https://github.com/LagrangeDev/Lagrange.Core /app
WORKDIR /app
RUN dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj \
--self-contained \
-p:PublishSingleFile=true \
-p:IncludeContentInSingleFile=true \
-p:RuntimeIdentifier=linux-musl-x64 \
-f net8.0 \
-c Release \
-o ./out
FROM alpine:latest
COPY --from=build-env /app/out /app
WORKDIR /app/data
RUN apk add --no-cache libstdc++ libgcc icu-libs && \
chmod +x /app/Lagrange.OneBot && \
mkdir -p /app/data
CMD ["../Lagrange.OneBot"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment