From 033415a2b41615357b3925aee2cb3518f31c8ae2 Mon Sep 17 00:00:00 2001 From: ledocool Date: Fri, 28 Jul 2023 17:35:19 +0700 Subject: [PATCH] add files for automatic ci --- .drone.yml | 16 ++++++++++++++++ Budet-cho-bot/Dockerfile | 12 ++++++++++++ docker-compose.yml | 9 +++++++++ 3 files changed, 37 insertions(+) create mode 100644 .drone.yml create mode 100644 Budet-cho-bot/Dockerfile create mode 100644 docker-compose.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e611abd --- /dev/null +++ b/.drone.yml @@ -0,0 +1,16 @@ +kind: pipeline +type: exec +name: backend + +steps: +- name: build + commands: + - docker-compose build + +- name: publish + commands: + - docker-compose up -d + +trigger: + branch: + - master \ No newline at end of file diff --git a/Budet-cho-bot/Dockerfile b/Budet-cho-bot/Dockerfile new file mode 100644 index 0000000..908f5cd --- /dev/null +++ b/Budet-cho-bot/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +WORKDIR /app + +COPY ./Budet-cho-bot ./Budet-cho-bot + +RUN dotnet restore Budet-cho-bot/Budet-cho-bot.fsproj +RUN dotnet publish Budet-cho-bot/Budet-cho-bot.fsproj -c Production -o /app/publish + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 as final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Budet-cho-bot.dll", "--environment=Development"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5e6371d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3.4' + +services: + bot: + image: bot + container_name: bot + build: + context: ./ + dockerfile: Budet-cho-bot/Dockerfile \ No newline at end of file