Add port and change docker file

This commit is contained in:
Joseph Ferano 2022-07-20 18:01:25 +07:00
parent c704a21787
commit f6f37654a1
2 changed files with 7 additions and 9 deletions

View File

@ -100,15 +100,13 @@ let configureLogging (builder : ILoggingBuilder) =
[<EntryPoint>] [<EntryPoint>]
let main args = let main args =
let contentRoot = Directory.GetCurrentDirectory()
let webRoot = Path.Combine(contentRoot, "WebRoot")
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults( .ConfigureWebHostDefaults(
fun webHostBuilder -> fun webHostBuilder ->
webHostBuilder webHostBuilder
.UseContentRoot(contentRoot) .ConfigureKestrel(fun opt ->
.UseWebRoot(webRoot) opt.AddServerHeader <- false
.ConfigureKestrel(fun opt -> opt.AddServerHeader <- false) opt.ListenLocalhost(3333, (fun o -> o.UseHttps() |> ignore)))
.Configure(Action<IApplicationBuilder> configureApp) .Configure(Action<IApplicationBuilder> configureApp)
.ConfigureServices(configureServices) .ConfigureServices(configureServices)
.ConfigureLogging(configureLogging) .ConfigureLogging(configureLogging)

View File

@ -12,12 +12,12 @@ RUN dotnet restore "Bot/Bot.fsproj"
WORKDIR "/src/Bot" WORKDIR "/src/Bot"
RUN dotnet build "Bot.fsproj" -c Release -o /app/build RUN dotnet build "CurrencyAPI.fsproj" -c Release -o /app/build
FROM build AS publish FROM build AS publish
RUN dotnet publish "Bot.fsproj" -c Release -o /app/publish RUN dotnet publish "CurrencyAPI.fsproj" -c Release -o /app/publish
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENTRYPOINT "./Bot" ENTRYPOINT "./CurrencyAPI.App"