Answer the question
In order to leave comments, you need to log in
How to run a Docker container?
I am transferring my API from the database to docker containers. Containers are created, at least with the "ps" command, I see them both running. But, there is a problem that when I run it after the containers have gone astray, I do not get any error, but displays the line: "The default language (LCID 0) has been set for engine and full-text services."
I decided to start-check whether docker starts without a database.
docker compose:
version: '3.9'
networks:
localdev:
name: localdev
services:
main-api:
build: .
restart: always
ports:
- "7000:80"
networks:
- localdev
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["ShoppingCart.API/ShoppingCart.API.csproj", "ShoppingCart.API/"]
#COPY ["ShoppingCart.Domain.Entities/ShoppingCart.Domain.Entities.csproj", "ShoppingCart.Domain.Entities/"]
#COPY ["ShoppingCart.Domain.Interfaces/ShoppingCart.Domain.Interfaces.csproj", "ShoppingCart.Domain.Interfaces/"]
#COPY ["ShoppingCart.Infrastructure.Data/ShoppingCart.Infrastructure.Data.csproj", "ShoppingCart.Infrastructure.Data/"]
#COPY ["ShoppingCart.Infrastructure.Business/ShoppingCart.Infrastructure.Business.csproj", "ShoppingCart.Infrastructure.Businesss/"]
#COPY ["ShoppingCart.Services.Interfaces/ShoppingCart.Services.Interfaces.csproj", "ShoppingCart.Services.Interfaces/"]
RUN dotnet restore "ShoppingCart.API/ShoppingCart.API.csproj"
COPY . .
WORKDIR "/src/ShoppingCart.API"
RUN dotnet build "ShoppingCart.API.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ShoppingCart.API.csproj" -c Release -o /app/publish
WORKDIR /app
COPY --from=build /app/build .
ENTRYPOINT ["dotnet", "ShoppingCart.API.dll"]
Answer the question
In order to leave comments, you need to log in
There is an error on this line:
ports:
- "7000:80"
ports:
- "5000:80"
- "5001:443"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question