Код: Выделить всё
client-1 | An error occurred: Object reference not set to an instance of an object.
client-1 | Connection lostUnable to read data from the transport connection: Software caused connection abort.
Код: Выделить всё
version: '3'
services:
server:
build:
context: .
dockerfile: Server/Dockerfile
ports:
- "8080:8080"
networks:
- chat-net
client:
build:
context: .
dockerfile: MyClientApp/Dockerfile
networks:
- chat-net
networks:
chat-net:
driver: bridge
Код: Выделить всё
FROM amazoncorretto:17
WORKDIR /app/Server
COPY . /app/Server
RUN javac Server.java
CMD ["java", "Server"]
Код: Выделить всё
FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /app
COPY MyClientApp/MyClientApp.csproj MyClientApp/
RUN dotnet restore MyClientApp/MyClientApp.csproj
COPY MyClientApp/ MyClientApp/
RUN dotnet build MyClientApp/MyClientApp.csproj -c Release -o out
CMD ["dotnet", "out/MyClientApp.dll"]
Проект
- Сервер
Server.java - Dockerfile
- Client.cs
- Dockerfile
-docker-compose.yml
Я пробовал
Код: Выделить всё
private const string serverIp = "server";
Подробнее здесь: https://stackoverflow.com/questions/791 ... and-client