mirror of
https://github.com/XFox111/backbone.git
synced 2026-04-22 07:17:59 +03:00
feat: upgrade to dotnet 10
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "Backbone",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0-noble",
|
||||
"image": "mcr.microsoft.com/devcontainers/dotnet:1-10.0-noble",
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
|
||||
+1
-2
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
@@ -15,4 +15,3 @@
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backbone", "Backbone.csproj", "{79FCBBD5-0D12-4E24-BADC-FC5C2613774C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{79FCBBD5-0D12-4E24-BADC-FC5C2613774C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{79FCBBD5-0D12-4E24-BADC-FC5C2613774C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{79FCBBD5-0D12-4E24-BADC-FC5C2613774C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{79FCBBD5-0D12-4E24-BADC-FC5C2613774C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,3 @@
|
||||
<Solution>
|
||||
<Project Path="Backbone.csproj" />
|
||||
</Solution>
|
||||
+13
-14
@@ -1,21 +1,20 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
|
||||
# Build stage
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine-aot AS build
|
||||
WORKDIR /build
|
||||
|
||||
# Installing additional dev dependencies for AOT
|
||||
RUN apk add clang binutils musl-dev build-base zlib-static
|
||||
ADD --link . .
|
||||
RUN --mount=type=cache,target=/root/.nuget \
|
||||
--mount=type=cache,target=/build/obj \
|
||||
--mount=type=cache,target=/build/bin \
|
||||
dotnet publish --runtime linux-musl-x64 --configuration Release --output /out \
|
||||
&& rm /out/*.dbg /out/*.endpoints.json /out/appsettings.Development.json
|
||||
|
||||
ADD *.csproj .
|
||||
RUN dotnet restore --runtime linux-musl-x64
|
||||
|
||||
ADD . ./
|
||||
RUN dotnet publish --configuration Release --no-restore --output /out
|
||||
|
||||
FROM scratch AS prod
|
||||
# Production stage
|
||||
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine AS prod
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /out/Backbone .
|
||||
COPY --from=build /out/appsettings*.json .
|
||||
COPY --link --from=build /out/Backbone .
|
||||
|
||||
EXPOSE 80
|
||||
USER $APP_UID
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT [ "./Backbone" ]
|
||||
CMD [ "--urls", "http://*:80" ]
|
||||
|
||||
@@ -66,7 +66,10 @@ dotnet build # Build the project for production
|
||||
To build a Docker image, run:
|
||||
|
||||
```bash
|
||||
docker build -t <tag_name> .
|
||||
docker build -t backbone:latest .
|
||||
|
||||
# To run the Docker container:
|
||||
docker run -d -p 8080:8080 --name backbone_server backbone:latest
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
|
||||
Reference in New Issue
Block a user