In your compose file, at the 'service' level, you can add extra_hosts my-service: I'd encourage you to find better explanations on the following suggestions: There are a couple of options, with trial and error to get the exact behavior you want. (The Dockerfile's should be irrelevant to your question.) Best to search on Networking in Compose as the starting point. "AUTH_CLIENT_SECRET": "974d6f71-d41b-4601-9a7a-a33081f80687"ĭockerfile: AuthServerWithDomain/DockerfileĪSPNETCORE_URLS: " ASPNETCORE_Kestrel_Certificates_Default_Path: "/https/aspnetappcert.pfx" "AUTH_CLIENT_ID": "recipe_management.swagger" recipemanagement-data:/var/lib/postgresql/dataĭockerfile: RecipeManagement/src/RecipeManagement/DockerfileĪSPNETCORE_URLS: ASPNETCORE_Kestrel_Certificates_Default_Path: "/https/aspnetappcert.pfx"ĪSPNETCORE_Kestrel_Certificates_Default_Password: "password"ĭB_CONNECTION_STRING: "Host=recipemanagement-db Port=5432 Database=dev_recipemanagement Username=postgres Password=postgres" RUN dotnet publish "AuthServerWithDomain/AuthServerWithDomain.csproj" -c Release -o /app/outĪnd the compose looks like this: version: '3.7' RUN dotnet build "AuthServerWithDomain/AuthServerWithDomain.csproj" -c Release -o /app/build RUN dotnet restore "./AuthServerWithDomain/AuthServerWithDomain.csproj" Project 2 has a dockerfile like this: FROM /dotnet/sdk:6.0 AS build-env RUN dotnet publish "RecipeManagement/src/RecipeManagement/RecipeManagement.csproj" -c Release -o /app/outĮNTRYPOINT RUN dotnet build "RecipeManagement/src/RecipeManagement/RecipeManagement.csproj" -c Release -o /app/build RUN dotnet restore "./RecipeManagement/src/RecipeManagement/RecipeManagement.csproj" # Copy csproj and restore as distinct layersĬOPY Project 1 has a dockerfile like this: FROM /dotnet/sdk:6.0 AS build-env When adding env variables with url paths to talk between containers, i generally use something like to resolve the path to the other container, but for some reason that doesn't resolve and just gets used as, for instance, instead of This doesn't make sense to me as i literally have another project on my machine that runs with this setup just fine. These work fine when running with dotnet run, but I'm having issues with my docker compose.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |