1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-09-20 01:39:00 +00:00

changed: migrated project to .NET 8, port changed to 8080

This commit is contained in:
Mia Rose Winter 2023-11-17 22:08:03 +01:00
parent 11aade220e
commit 1d70796d70
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
5 changed files with 24 additions and 13 deletions

View file

@ -22,4 +22,9 @@
**/secrets.dev.yaml **/secrets.dev.yaml
**/values.dev.yaml **/values.dev.yaml
LICENSE LICENSE
README.md README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**

View file

@ -1,19 +1,22 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["JustShortIt.csproj", "."] COPY ["JustShortIt.csproj", "."]
RUN dotnet restore "./JustShortIt.csproj" RUN dotnet restore "./././JustShortIt.csproj"
COPY . . COPY . .
WORKDIR "/src/." WORKDIR "/src/."
RUN dotnet build "JustShortIt.csproj" -c Release -o /app/build RUN dotnet build "./JustShortIt.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish FROM build AS publish
RUN dotnet publish "JustShortIt.csproj" -c Release -o /app/publish /p:UseAppHost=false ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./JustShortIt.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
@ -17,9 +17,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.5" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.2" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="StackExchange.Redis" Version="2.6.104" /> <PackageReference Include="StackExchange.Redis" Version="2.7.4" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -7,7 +7,7 @@
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
}, },
"dotnetRunMessages": true, "dotnetRunMessages": true,
"applicationUrl": "http://localhost:5128" "applicationUrl": "http://localhost:8080"
}, },
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
@ -18,8 +18,10 @@
}, },
"Docker": { "Docker": {
"commandName": "Docker", "commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"environmentVariables": {
"ASPNETCORE_HTTP_PORTS": "8080"
},
"publishAllPorts": true "publishAllPorts": true
} }
}, },

View file

@ -92,6 +92,7 @@ services:
- "JSI_Redis__ConnectionString=redis,password=<your-redis-password>" - "JSI_Redis__ConnectionString=redis,password=<your-redis-password>"
environment: environment:
- "VIRTUAL_HOST=<your-url>" - "VIRTUAL_HOST=<your-url>"
- "VIRTUAL_PORT=8080"
- "LETSENCRYPT_HOST=<your-url>" - "LETSENCRYPT_HOST=<your-url>"
depends_on: depends_on:
- redis - redis