1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-11-22 00:09:54 +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

@ -23,3 +23,8 @@
**/values.dev.yaml
LICENSE
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.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER 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
COPY ["JustShortIt.csproj", "."]
RUN dotnet restore "./JustShortIt.csproj"
RUN dotnet restore "./././JustShortIt.csproj"
COPY . .
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
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
WORKDIR /app

View file

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

View file

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

View file

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