I am writing docker container. I it stands up but in my opinion, it does not work. I want to run dotnet app, that uses rabbitmq to communication. After running command: 'docker-compose logs mlmodule' it does not show any logs (but it should). I think that it is caused by wrong image code. I am newbie to docker and docker-compose.
This is the code of image
#docker base SDK image
FROM mcr.microsoft.com/dotnet/sdk:5.0 as build-env
WORKDIR mlmodule
#copy the CSPROJ file and restore any dependecies
COPY mlmodule/*.csproj ./
RUN dotnet restore
#copy project files and build release
COPY / ./
RUN dotnet publish mlmodule.sln -c Release -o out
#Generate runtime image
FROM mcr.microsoft.com/dotnet/runtime:5.0.9-alpine3.13-amd64
WORKDIR mlmodule
COPY --from=build-env mlmodule/out .
And thats the code of docker-compose:
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: 'rabbitmq'
ports:
- 5672:5672
- 15672:15672
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/data/:/var/log/rabbitmq/
networks:
- rabbitmq_go_net
ml-module:
build: ./mlmodule/
container_name: ml-module
environment:
CLOUDSDK_PYTHON: /usr/bin/python3
LD_LIBRARY_PATH: /usr/local/lib
depends_on:
- rabbitmq
tty: true
networks:
- rabbitmq_go_net
EDIT:
I propably fixed rabbitmq container, now I see logs:
ml-module | Could not execute because the specified command or file was not found.
ml-module | Possible reasons for this include:
ml-module | * You misspelled a built-in dotnet command.
ml-module | * You intended to execute a .NET program, but dotnet-MLModule.sln does not exist.
ml-module | * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.