C
C#8mo 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
Stan8mo ago
anything in docker-compose.override.yaml that might break it?
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
Dou
Dou8mo ago
I haven't created a repo yet but here's the full source
Dou
Dou8mo 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
More Posts
index outside the bounds of array errorso i have this program that is supposed to make the user add the amount of students in a class then ✅ Unsuccessfully trying to parse web pages.I want to parse last.fm for artists but my code works only first iteration, in all iterations where ❔ Career PathCurrently I'm learning and getting better at desktop development but I've seen many posts and forums❔ Benchmarking object size differenceI've got a small PR here to move a few `bool` fields into an existing "status" `int`. My understandi❔ How can I diff 2 strings?How can I find the difference between two strings (added/removed/modified characters/words)❔ In need of a way to process inputs to produce outputs, other than using hardcoded if statementsHi all, I currently have a program that prompts the user to ask a question, then based on the parame❔ € symbol prints to console in Rider, but not Visual StudioHey all, Sorry if this is a stupid question, but I'm using Rider IDE on Ubuntu and working on a col❔ Local Environment throwing exception when calling HttpClient.GetStringAsyncI am running the below code via Visual Studio Code, and a "The requested address is not valid in its❔ How to stop WebClient.DownloadString encoding apostrophies?Does anyone know why WebClient.DownloadString encodes certain characters (e.g. apostrophe) even when❔ implementing openvpn to my c# wpf appI am trying to make a vpn app for my school project and I was wondering how I could implement openvp