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>]
let main args =
let contentRoot = Directory.GetCurrentDirectory()
let webRoot = Path.Combine(contentRoot, "WebRoot")
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(
fun webHostBuilder ->
webHostBuilder
.UseContentRoot(contentRoot)
.UseWebRoot(webRoot)
.ConfigureKestrel(fun opt -> opt.AddServerHeader <- false)
.ConfigureKestrel(fun opt ->
opt.AddServerHeader <- false
opt.ListenLocalhost(3333, (fun o -> o.UseHttps() |> ignore)))
.Configure(Action<IApplicationBuilder> configureApp)
.ConfigureServices(configureServices)
.ConfigureLogging(configureLogging)

View File

@ -12,12 +12,12 @@ RUN dotnet restore "Bot/Bot.fsproj"
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
RUN dotnet publish "Bot.fsproj" -c Release -o /app/publish
RUN dotnet publish "CurrencyAPI.fsproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT "./Bot"
ENTRYPOINT "./CurrencyAPI.App"