diff --git a/JOBot.Backend/Dockerfile b/JOBot.Backend/Dockerfile new file mode 100644 index 0000000..ef4caf5 --- /dev/null +++ b/JOBot.Backend/Dockerfile @@ -0,0 +1,11 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /src +COPY ["JOBot.Backend/JOBot.Backend.csproj", "JOBot.Backend/"] +RUN dotnet restore "JOBot.Backend/JOBot.Backend.csproj" +COPY . . +RUN dotnet publish "JOBot.Backend/JOBot.Backend.csproj" -c Release -o /app + +FROM mcr.microsoft.com/dotnet/aspnet:9.0 +WORKDIR /app +COPY --from=build /app . +ENTRYPOINT ["dotnet", "JOBot.Backend.dll"] \ No newline at end of file diff --git a/JOBot.TClient/Dockerfile b/JOBot.TClient/Dockerfile new file mode 100644 index 0000000..2af8f3f --- /dev/null +++ b/JOBot.TClient/Dockerfile @@ -0,0 +1,11 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /src +COPY ["JOBot.TClient/JOBot.TClient.csproj", "JOBot.TClient/"] +RUN dotnet restore "JOBot.TClient/JOBot.TClient.csproj" +COPY . . +RUN dotnet publish "JOBot.TClient/JOBot.TClient.csproj" -c Release -o /app + +FROM mcr.microsoft.com/dotnet/runtime:9.0 +WORKDIR /app +COPY --from=build /app . +ENTRYPOINT ["dotnet", "JOBot.TClient.dll"] \ No newline at end of file diff --git a/compose.yml b/compose.yml index d6bacec..b0fe59b 100644 --- a/compose.yml +++ b/compose.yml @@ -9,4 +9,27 @@ services: ports: - "5432:5432" volumes: - - ./.docker/postgres_data:/var/lib/postgresql/data \ No newline at end of file + - ./.docker/postgres_data:/var/lib/postgresql/data + networks: + - jobot + + backend: + build: + context: . + dockerfile: JOBot.Backend/Dockerfile + depends_on: + - postgres + networks: + - jobot + + bot: + build: + context: . + dockerfile: JOBot.TClient/Dockerfile + depends_on: + - backend + networks: + - jobot + +networks: + jobot: \ No newline at end of file