Skip to content

Commit 7ddb2e4

Browse files
committed
Move to docker and .NET 7.0, YOLO
1 parent c17a74f commit 7ddb2e4

File tree

7 files changed

+103
-43
lines changed

7 files changed

+103
-43
lines changed

.vscode/launch.json

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
{
2-
// Use IntelliSense to find out which attributes exist for C# debugging
3-
// Use hover for the description of the existing attributes
4-
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": ".NET Core Launch (web)",
9-
"type": "coreclr",
10-
"request": "launch",
11-
"preLaunchTask": "build",
12-
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/bin/Debug/net6.0/devanewbot.dll",
14-
"args": [],
15-
"cwd": "${workspaceFolder}",
16-
"stopAtEntry": false,
17-
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18-
"env": {
19-
"ASPNETCORE_ENVIRONMENT": "Development"
20-
},
21-
"sourceFileMap": {
22-
"/Views": "${workspaceFolder}/Views"
23-
}
24-
},
25-
{
26-
"name": ".NET Core Attach",
27-
"type": "coreclr",
28-
"request": "attach",
29-
"processId": "${command:pickProcess}"
30-
}
31-
]
32-
}
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (web)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/bin/Debug/net7.0/devanewbot.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}",
16+
"stopAtEntry": false,
17+
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18+
"env": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
},
21+
"sourceFileMap": {
22+
"/Views": "${workspaceFolder}/Views"
23+
}
24+
},
25+
{
26+
"name": ".NET Core Attach",
27+
"type": "coreclr",
28+
"request": "attach",
29+
"processId": "${command:pickProcess}"
30+
}
31+
]
32+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cSpell.words": [
33
"Devanewbot"
4-
]
4+
],
5+
"dotnet.defaultSolution": "devanewbot.sln"
56
}

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
2+
3+
WORKDIR /app
4+
EXPOSE 5010
5+
6+
7+
ENV ASPNETCORE_URLS=http://+:5010
8+
9+
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
10+
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
11+
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
12+
USER appuser
13+
14+
FROM node:18-bullseye-slim AS vuebuild
15+
WORKDIR /src
16+
COPY ["vue", "vue"]
17+
WORKDIR "/src/vue"
18+
RUN npm ci
19+
RUN export NODE_OPTIONS=--openssl-legacy-provider && \
20+
npm run build
21+
22+
23+
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS publish
24+
WORKDIR /src
25+
COPY . .
26+
WORKDIR "/src"
27+
RUN dotnet build "devanewbot.csproj" -c Release -o /app/publish
28+
29+
FROM base AS final
30+
WORKDIR /app
31+
COPY --from=publish /app/publish .
32+
COPY --from=vuebuild /src/wwwroot wwwroot
33+
ENTRYPOINT ["dotnet", "devanewbot.dll"]

Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using devanewbot.Services;
77
using Devanewbot.Discord;
88
using Hangfire;
9+
using Hangfire.Redis.StackExchange;
910
using Microsoft.AspNetCore.Builder;
1011
using Microsoft.AspNetCore.Http;
1112
using Microsoft.AspNetCore.HttpOverrides;

devanewbot.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<VersionPrefix>1.0.0</VersionPrefix>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AspNetCore.ReCaptcha" Version="1.6.0" />
10-
<PackageReference Include="Discord.NET" Version="3.4.1" />
11-
<PackageReference Include="Flurl" Version="3.0.4" />
12-
<PackageReference Include="Flurl.Http" Version="3.2.2" />
13-
<PackageReference Include="Hangfire" Version="1.7.28" />
14-
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.8.5" />
15-
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
16-
<PackageReference Include="Magick.NET-Q16-HDRI-AnyCPU" Version="11.3.0" />
9+
<PackageReference Include="AspNetCore.ReCaptcha" Version="1.7.0" />
10+
<PackageReference Include="Discord.NET" Version="3.11.0" />
11+
<PackageReference Include="Flurl" Version="3.0.7" />
12+
<PackageReference Include="Flurl.Http" Version="3.2.4" />
13+
<PackageReference Include="Hangfire" Version="1.8.3" />
14+
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.9.0" />
15+
<PackageReference Include="HtmlAgilityPack" Version="1.11.49" />
16+
<PackageReference Include="Magick.NET-Q16-HDRI-AnyCPU" Version="13.1.3" />
1717
<PackageReference Include="RollbarDotNet" Version="0.7.0" />
18-
<PackageReference Include="WebSocketExtensions" Version="2.1.9" />
18+
<PackageReference Include="WebSocketExtensions" Version="2.6.0" />
1919
</ItemGroup>
2020

2121
</Project>

devanewbot.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.001.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "devanewbot", "devanewbot.csproj", "{6CD3FC9D-7DE8-4D61-84F1-261E22A767A8}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{6CD3FC9D-7DE8-4D61-84F1-261E22A767A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6CD3FC9D-7DE8-4D61-84F1-261E22A767A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6CD3FC9D-7DE8-4D61-84F1-261E22A767A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{6CD3FC9D-7DE8-4D61-84F1-261E22A767A8}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {14E21735-BF58-4F48-9970-848C5DF05E5F}
24+
EndGlobalSection
25+
EndGlobal

vue/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
"plugin:vue/vue3-essential",
88
"eslint:recommended",
99
"@vue/typescript/recommended",
10-
"plugin:prettier/recommended",
10+
//"plugin:prettier/recommended",
1111
],
1212
parserOptions: {
1313
ecmaVersion: 2020,

0 commit comments

Comments
 (0)