Compare commits
No commits in common. "e65bfa501af964bd7ab3fb0ed4a8783667e2c12c" and "4df44374876d9c03a6162cd99e206cdee9ae5bfc" have entirely different histories.
e65bfa501a
...
4df4437487
70
Dockerfile
70
Dockerfile
@ -1,70 +0,0 @@
|
|||||||
# dotnet build environment
|
|
||||||
FROM alpine:latest as dotnet
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
RUN apk add dotnet8-sdk git
|
|
||||||
RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
|
||||||
|
|
||||||
WORKDIR /hiveemulator/src/CommunicationControl/
|
|
||||||
RUN dotnet build DevOpsProject/DevOpsProject.CommunicationControl.API.csproj
|
|
||||||
RUN dotnet build DevOpsProject.HiveMind.API/DevOpsProject.HiveMind.API.csproj
|
|
||||||
|
|
||||||
|
|
||||||
# nodejs build environment
|
|
||||||
#FROM alpine:latest as nodejs
|
|
||||||
#WORKDIR /
|
|
||||||
|
|
||||||
#RUN apk add git npm
|
|
||||||
#RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
|
||||||
|
|
||||||
#WORKDIR /hiveemulator/src/MapClient/
|
|
||||||
#RUN npm install
|
|
||||||
#RUN npm run build
|
|
||||||
|
|
||||||
|
|
||||||
# production environment
|
|
||||||
FROM alpine:latest
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
#RUN apk add dotnet8-sdk redis openrc lighttpd npm
|
|
||||||
#RUN apk add git dotnet8-sdk redis openrc npm
|
|
||||||
#RUN apk add git aspnetcore8-runtime redis openrc npm
|
|
||||||
RUN apk add aspnetcore8-runtime redis openrc npm
|
|
||||||
|
|
||||||
#RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
|
||||||
#COPY --from=nodejs /hiveemulator/ /hiveemulator/
|
|
||||||
COPY --from=dotnet /hiveemulator/ /hiveemulator/
|
|
||||||
#COPY --from=nodejs /hiveemulator/src/MapClient/dist/* /var/www/localhost/htdocs/
|
|
||||||
|
|
||||||
#RUN mkdir /hive-cc
|
|
||||||
#COPY --from=0 /hiveemulator/src/CommunicationControl/DevOpsProject/* /hive-cc/
|
|
||||||
#COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject/* /hiveemulator/src/CommunicationControl/DevOpsProject/
|
|
||||||
#COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/* /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/
|
|
||||||
|
|
||||||
#RUN mkdir /hive-hm
|
|
||||||
#COPY --from=0 /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/* /hive-hm/
|
|
||||||
|
|
||||||
WORKDIR /hiveemulator/src/MapClient/
|
|
||||||
RUN npm install
|
|
||||||
RUN sed -i 's/localhost/10\.1\.1\.2/' public/config.json
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
COPY ./daemon-files/hive-cc /etc/init.d/hive-cc
|
|
||||||
COPY ./daemon-files/hive-hm /etc/init.d/hive-hm
|
|
||||||
COPY ./daemon-files/hive-map /etc/init.d/hive-map
|
|
||||||
RUN chmod u+x /etc/init.d/hive-hm /etc/init.d/hive-cc /etc/init.d/hive-map
|
|
||||||
|
|
||||||
#RUN mkdir /etc/rulevels/{stage-redis,stage-cc,stage-hm,stage-map}
|
|
||||||
|
|
||||||
#RUN rc-update add redis default
|
|
||||||
#RUN rc-update add hive-hm default
|
|
||||||
#RUN rc-update add hive-cc default
|
|
||||||
#RUN rc-update add hive-map default
|
|
||||||
|
|
||||||
CMD sh -c "openrc default ; \
|
|
||||||
rc-service redis start ; \
|
|
||||||
rc-service hive-cc start ; \
|
|
||||||
rc-service hive-hm start ; \
|
|
||||||
rc-service hive-map start ; \
|
|
||||||
sleep 96h; \
|
|
||||||
exec sh"
|
|
@ -44,7 +44,7 @@ dotnet run --project DevOpsProject/DevOpsProject.CommunicationControl.API.cspro
|
|||||||
```bash
|
```bash
|
||||||
cd src/CommunicationControl
|
cd src/CommunicationControl
|
||||||
|
|
||||||
dotnet run --project DevOpsProject.HiveMind.API/DevOpsProject.HiveMind.API.csproj
|
dotnet run --project DevOpsProject/DevOpsProject.HiveMind.API.csproj
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -64,8 +64,6 @@ dotnet run --project DevOpsProject.HiveMind.API/DevOpsProject.HiveMind.API.cspr
|
|||||||
|
|
||||||
### Map Clinet
|
### Map Clinet
|
||||||
cd src/MapClient
|
cd src/MapClient
|
||||||
|
|
||||||
npm install
|
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
### Communiction Control
|
### Communiction Control
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
#!/sbin/openrc-run
|
|
||||||
|
|
||||||
command="./DevOpsProject.CommunicationControl.API"
|
|
||||||
command_args=""
|
|
||||||
pidfile="/run/hive-cc.pid"
|
|
||||||
supervisor="supervise-daemon"
|
|
||||||
|
|
||||||
start_pre() {
|
|
||||||
cd /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Debug/net8.0/
|
|
||||||
}
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need redis
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/sbin/openrc-run
|
|
||||||
|
|
||||||
command="./DevOpsProject.HiveMind.API"
|
|
||||||
command_args=""
|
|
||||||
pidfile="/run/hive-hm.pid"
|
|
||||||
supervisor="supervise-daemon"
|
|
||||||
|
|
||||||
start_pre() {
|
|
||||||
cd /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Debug/net8.0/
|
|
||||||
}
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need hive-cc
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/sbin/openrc-run
|
|
||||||
|
|
||||||
command="npm"
|
|
||||||
command_args="run dev"
|
|
||||||
pidfile="/run/hive-map.pid"
|
|
||||||
supervisor="supervise-daemon"
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need hive-cc
|
|
||||||
}
|
|
||||||
|
|
||||||
start_pre() {
|
|
||||||
cd /hiveemulator/src/MapClient/
|
|
||||||
}
|
|
@ -57,8 +57,11 @@ using (var scope = app.Services.CreateScope())
|
|||||||
app.UseExceptionHandler();
|
app.UseExceptionHandler();
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
app.UseSwagger();
|
if (app.Environment.IsDevelopment())
|
||||||
app.UseSwaggerUI();
|
{
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
|
}
|
||||||
|
|
||||||
app.UseCors(corsPolicyName);
|
app.UseCors(corsPolicyName);
|
||||||
|
|
||||||
|
@ -19,8 +19,6 @@ internal class Program
|
|||||||
// TODO: consider this approach
|
// TODO: consider this approach
|
||||||
builder.Services.AddJsonControllerOptionsConfiguration();
|
builder.Services.AddJsonControllerOptionsConfiguration();
|
||||||
|
|
||||||
string basePath = builder.Configuration.GetValue<string>("BasePath") ?? string.Empty;
|
|
||||||
|
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen(c =>
|
builder.Services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
@ -43,26 +41,13 @@ internal class Program
|
|||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
if (!string.IsNullOrEmpty(basePath))
|
|
||||||
{
|
|
||||||
var pathBase = new PathString(basePath);
|
|
||||||
app.UsePathBase(pathBase);
|
|
||||||
app.Use(async (context, next) =>
|
|
||||||
{
|
|
||||||
context.Request.PathBase = pathBase;
|
|
||||||
await next();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
app.UseExceptionHandler();
|
app.UseExceptionHandler();
|
||||||
|
|
||||||
app.UseSwagger();
|
|
||||||
app.UseSwaggerUI(c =>
|
|
||||||
{
|
|
||||||
c.SwaggerEndpoint($"{basePath}/swagger/v1/swagger.json", "CommunicationControl - V1");
|
|
||||||
c.RoutePrefix = $"swagger";
|
|
||||||
|
|
||||||
});
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
|
|
||||||
app.UseCors(corsPolicyName);
|
app.UseCors(corsPolicyName);
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Redis": {
|
"Redis": {
|
||||||
"ConnectionString": "localhost:6379",
|
"ConnectionString": "kpi-demo.redis.cache.windows.net:6380,password=9Q72KUy4sNUShczfk09f1WVEj504TrzVeAzCaGyo744=,ssl=True,abortConnect=False",
|
||||||
"PublishChannel": "HiveChannel"
|
"PublishChannel": "HiveChannel"
|
||||||
},
|
},
|
||||||
"RedisKeys": {
|
"RedisKeys": {
|
||||||
@ -20,7 +20,6 @@
|
|||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"Urls": "http://0.0.0.0:8080",
|
"Urls": "http://0.0.0.0:8080",
|
||||||
"BasePath": "",
|
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
||||||
"MinimumLevel": {
|
"MinimumLevel": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user