NUH-40: Add Dockerfile support for NucuCar.Sensors

This commit is contained in:
Denis-Cosmin Nutiu 2020-08-09 12:49:36 +03:00
parent b233b48336
commit ed4688c9e8
4 changed files with 25 additions and 4 deletions

View 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

View file

@ -26,7 +26,6 @@ namespace NucuCar.Sensors.Grpc
}
app.UseRouting();
app.UseHttpsRedirection();
app.UseEndpoints(endpoints =>
{

View file

@ -28,8 +28,8 @@
"Protocols": "Http2"
},
"EndPoints": {
"Https": {
"Url": "https://0.0.0.0:8000"
"Http": {
"Url": "http://0.0.0.0:8000"
}
}
}

View file

@ -18,7 +18,7 @@ namespace NucuCar.TestClient.Sensors
public class SensorsCmdOptions
{
[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; }
[Option('s', "sensor", Required = false, HelpText = "The sensor name you'd like to test.",