Last active
May 12, 2024 08:54
-
-
Save mnixry/bdc06cfc70c25e3b418ebca27c2ced32 to your computer and use it in GitHub Desktop.
Dockerfile for https://github.com/LagrangeDev/Lagrange.Core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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