Skip to content

Commit eac06e8

Browse files
committed
builds docker image
1 parent f7fa35c commit eac06e8

16 files changed

+44
-6
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Docker - AutoClientCenter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*.*.*'
9+
paths:
10+
- 'Tools/AutoClientCenter/**'
11+
- '!Tools/AutoClientCenter/Dockerfile'
12+
- .github/workflows/docker-autoclientcenter.yml
13+
- .github/workflows/docker-reusable.yml
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-and-push:
18+
name: Build and Push
19+
uses: ./.github/workflows/docker-reusable.yml
20+
with:
21+
docker_file: Tools/AutoClientCenter/Dockerfile
22+
docker_repo: codexstorage/codex-autoclientcenter
23+
secrets: inherit
24+
File renamed without changes.

AutoClientCenter/Dockerfile renamed to Tools/AutoClientCenter/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
44
USER app
55
WORKDIR /app
6-
EXPOSE 8080
7-
EXPOSE 8081
86

97
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
108
ARG BUILD_CONFIGURATION=Release
File renamed without changes.

AutoClientCenter/Program.cs renamed to Tools/AutoClientCenter/Program.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ public static void Main(string[] args)
77
{
88
var builder = WebApplication.CreateBuilder(args);
99

10+
var listenPort = Environment.GetEnvironmentVariable("APIPORT");
11+
if (string.IsNullOrEmpty(listenPort)) listenPort = "31090";
12+
13+
builder.WebHost.ConfigureKestrel((context, options) =>
14+
{
15+
options.ListenAnyIP(Convert.ToInt32(listenPort));
16+
});
17+
1018
builder.Services.AddSingleton<ITaskService>(new TaskService());
1119
builder.Services.AddControllers();
1220
builder.Services.AddEndpointsApiExplorer();
@@ -27,6 +35,8 @@ public static void Main(string[] args)
2735

2836
app.MapControllers();
2937

38+
Console.WriteLine("AutoClientCenter listening on port " + listenPort);
39+
3040
app.Run();
3141
}
3242
}

Tools/MarketInsights/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
44
USER app
55
WORKDIR /app
6-
EXPOSE 8080
7-
EXPOSE 8081
86

97
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
108
ARG BUILD_CONFIGURATION=Release

Tools/MarketInsights/Program.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using ArgsUniform;
2-
using Microsoft.Extensions.Options;
3-
using Nethereum.Model;
42
using System.Reflection;
53

64
namespace MarketInsights
@@ -28,6 +26,14 @@ public static void Main(string[] args)
2826

2927
var builder = WebApplication.CreateBuilder(args);
3028

29+
var listenPort = Environment.GetEnvironmentVariable("APIPORT");
30+
if (string.IsNullOrEmpty(listenPort)) listenPort = "31090";
31+
32+
builder.WebHost.ConfigureKestrel((context, options) =>
33+
{
34+
options.ListenAnyIP(Convert.ToInt32(listenPort));
35+
});
36+
3137
builder.Services.AddSingleton(appState);
3238

3339
builder.Services.AddControllers();
@@ -54,6 +60,8 @@ public static void Main(string[] args)
5460

5561
app.MapControllers();
5662

63+
Console.WriteLine("MarketInsights listening on port " + listenPort);
64+
5765
updater.Run();
5866
app.Run();
5967
}

0 commit comments

Comments
 (0)