NUH-40: Add Dockerfile support for NucuCar.Sensors
This commit is contained in:
parent
b233b48336
commit
ed4688c9e8
4 changed files with 25 additions and 4 deletions
22
NucuCar.Sensors/Dockerfile
Normal file
22
NucuCar.Sensors/Dockerfile
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# To build this image use the following command:
|
||||||
|
# docker build . -f ./NucuCar/NucuCar.Sensors/Dockerfile -t NucuCar_Sensors
|
||||||
|
# To debug: docker run -it NucuCar_Sensors /bin/bash
|
||||||
|
|
||||||
|
# STAGE 0: Build the program.
|
||||||
|
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
|
||||||
|
MAINTAINER Denis Nutiu
|
||||||
|
|
||||||
|
# Copy the NucuHub folder into the workdir
|
||||||
|
WORKDIR /root/build
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN dotnet build --configuration Release -o dist
|
||||||
|
|
||||||
|
# STAGE 1: Run the program.
|
||||||
|
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
|
||||||
|
|
||||||
|
# Copy the built program into workdir.
|
||||||
|
WORKDIR /root/app
|
||||||
|
COPY --from=0 /root/build/dist/ .
|
||||||
|
|
||||||
|
CMD /root/app/NucuCar.Sensors
|
|
@ -26,7 +26,6 @@ namespace NucuCar.Sensors.Grpc
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseHttpsRedirection();
|
|
||||||
|
|
||||||
app.UseEndpoints(endpoints =>
|
app.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
"Protocols": "Http2"
|
"Protocols": "Http2"
|
||||||
},
|
},
|
||||||
"EndPoints": {
|
"EndPoints": {
|
||||||
"Https": {
|
"Http": {
|
||||||
"Url": "https://0.0.0.0:8000"
|
"Url": "http://0.0.0.0:8000"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace NucuCar.TestClient.Sensors
|
||||||
public class SensorsCmdOptions
|
public class SensorsCmdOptions
|
||||||
{
|
{
|
||||||
[Option('u', "url", Required = false, HelpText = "The url and port of the gRPC server.",
|
[Option('u', "url", Required = false, HelpText = "The url and port of the gRPC server.",
|
||||||
Default = "https://localhost:8000")]
|
Default = "http://localhost:8000")]
|
||||||
public string GrpcServiceAddress { get; set; }
|
public string GrpcServiceAddress { get; set; }
|
||||||
|
|
||||||
[Option('s', "sensor", Required = false, HelpText = "The sensor name you'd like to test.",
|
[Option('s', "sensor", Required = false, HelpText = "The sensor name you'd like to test.",
|
||||||
|
|
Loading…
Reference in a new issue