C
C#13mo ago
Dou

Docker container works fine in manual invocation but not when started via VS2022's start button

My project structure:
├── ComBin.sln
├── docker-compose.dcproj
├── docker-compose.dcproj.user
├── docker-compose.override.yml
├── docker-compose.yml
├── launchSettings.json
└── src
├── ComBin.Server
└── combin.client
├── ComBin.sln
├── docker-compose.dcproj
├── docker-compose.dcproj.user
├── docker-compose.override.yml
├── docker-compose.yml
├── launchSettings.json
└── src
├── ComBin.Server
└── combin.client
docker-compose.yml:
version: '3.4'
services:
combin.server:
image: ${DOCKER_REGISTRY-}combinserver
build:
context: .
dockerfile: src/ComBin.Server/Dockerfile
depends_on:
- combin.database
combin.database:
image: postgres:latest
container_name: combin-database
environment:
- POSTGRES_PASSWORD=tobechanged
volumes:
- "combin-database-volume:/var/lib/postgresql/data"
expose:
- "5432"
volumes:
combin-database-volume:
version: '3.4'
services:
combin.server:
image: ${DOCKER_REGISTRY-}combinserver
build:
context: .
dockerfile: src/ComBin.Server/Dockerfile
depends_on:
- combin.database
combin.database:
image: postgres:latest
container_name: combin-database
environment:
- POSTGRES_PASSWORD=tobechanged
volumes:
- "combin-database-volume:/var/lib/postgresql/data"
expose:
- "5432"
volumes:
combin-database-volume:
Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM node:21-slim AS node-base
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
COPY --from=node-base . .
WORKDIR /src

COPY "src/combin.client/combin.client.esproj" "combin.client/combin.client.esproj"
COPY "src/ComBin.Server/ComBin.Server.csproj" "ComBin.Server/ComBin.Server.csproj"
RUN dotnet restore "./ComBin.Server/./ComBin.Server.csproj"
COPY src .
WORKDIR "/src/ComBin.Server"
RUN dotnet build "./ComBin.Server.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./ComBin.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ComBin.Server.dll"]
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM node:21-slim AS node-base
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
COPY --from=node-base . .
WORKDIR /src

COPY "src/combin.client/combin.client.esproj" "combin.client/combin.client.esproj"
COPY "src/ComBin.Server/ComBin.Server.csproj" "ComBin.Server/ComBin.Server.csproj"
RUN dotnet restore "./ComBin.Server/./ComBin.Server.csproj"
COPY src .
WORKDIR "/src/ComBin.Server"
RUN dotnet build "./ComBin.Server.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./ComBin.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ComBin.Server.dll"]
When I start the project with docker-compose up it works just fine but starting it via VS fails with this error:
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application '/app/ComBin.Server.dll' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application '/app/ComBin.Server.dll' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.
4 Replies
Stan
Stan13mo ago
anything in docker-compose.override.yaml that might break it?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Dou
DouOP13mo ago
I haven't created a repo yet but here's the full source
Dou
DouOP13mo ago
Ok, I'm too lazy to keep dealing with this so I started a new project from scratch and it somehow fixed itself. Good enough for me
Want results from more Discord servers?
Add your server