feat: added docker build for projects
This commit is contained in:
parent
95e1f3bcac
commit
ace122dbbd
11
JOBot.Backend/Dockerfile
Normal file
11
JOBot.Backend/Dockerfile
Normal file
@ -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"]
|
11
JOBot.TClient/Dockerfile
Normal file
11
JOBot.TClient/Dockerfile
Normal file
@ -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"]
|
23
compose.yml
23
compose.yml
@ -10,3 +10,26 @@ services:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./.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:
|
Loading…
x
Reference in New Issue
Block a user