builds docker image
This commit is contained in:
parent
f7fa35c7ba
commit
eac06e8b3a
|
@ -0,0 +1,24 @@
|
|||
name: Docker - AutoClientCenter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
paths:
|
||||
- 'Tools/AutoClientCenter/**'
|
||||
- '!Tools/AutoClientCenter/Dockerfile'
|
||||
- .github/workflows/docker-autoclientcenter.yml
|
||||
- .github/workflows/docker-reusable.yml
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
name: Build and Push
|
||||
uses: ./.github/workflows/docker-reusable.yml
|
||||
with:
|
||||
docker_file: Tools/AutoClientCenter/Dockerfile
|
||||
docker_repo: codexstorage/codex-autoclientcenter
|
||||
secrets: inherit
|
||||
|
|
@ -3,8 +3,6 @@
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
USER app
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
|
@ -7,6 +7,14 @@ namespace AutoClientCenter
|
|||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var listenPort = Environment.GetEnvironmentVariable("APIPORT");
|
||||
if (string.IsNullOrEmpty(listenPort)) listenPort = "31090";
|
||||
|
||||
builder.WebHost.ConfigureKestrel((context, options) =>
|
||||
{
|
||||
options.ListenAnyIP(Convert.ToInt32(listenPort));
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton<ITaskService>(new TaskService());
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
|
@ -27,6 +35,8 @@ namespace AutoClientCenter
|
|||
|
||||
app.MapControllers();
|
||||
|
||||
Console.WriteLine("AutoClientCenter listening on port " + listenPort);
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
|
@ -3,8 +3,6 @@
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
USER app
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using ArgsUniform;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Nethereum.Model;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MarketInsights
|
||||
|
@ -28,6 +26,14 @@ namespace MarketInsights
|
|||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var listenPort = Environment.GetEnvironmentVariable("APIPORT");
|
||||
if (string.IsNullOrEmpty(listenPort)) listenPort = "31090";
|
||||
|
||||
builder.WebHost.ConfigureKestrel((context, options) =>
|
||||
{
|
||||
options.ListenAnyIP(Convert.ToInt32(listenPort));
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton(appState);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
@ -54,6 +60,8 @@ namespace MarketInsights
|
|||
|
||||
app.MapControllers();
|
||||
|
||||
Console.WriteLine("MarketInsights listening on port " + listenPort);
|
||||
|
||||
updater.Run();
|
||||
app.Run();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue