From 967f04ebbcfad8bcc43cc4569d6f8c7d63636fbf Mon Sep 17 00:00:00 2001 From: Grae Jones Date: Tue, 17 Mar 2026 18:23:32 -0700 Subject: [PATCH] First Produciton Attempt --- .gitea/workflows/ci.yaml | 35 +++++++++++++++++++++++++++++------ Creative/Dockerfile | 16 ++++++++++++++++ Gateway/Dockerfile | 16 ++++++++++++++++ GoogleApi/Dockerfile | 16 ++++++++++++++++ IntelligenceApi/Dockerfile | 16 ++++++++++++++++ Management/Dockerfile | 16 ++++++++++++++++ MetaApi/Dockerfile | 16 ++++++++++++++++ Registration/Dockerfile | 16 ++++++++++++++++ TikTokApi/Dockerfile | 16 ++++++++++++++++ 9 files changed, 157 insertions(+), 6 deletions(-) create mode 100644 Creative/Dockerfile create mode 100644 Gateway/Dockerfile create mode 100644 GoogleApi/Dockerfile create mode 100644 IntelligenceApi/Dockerfile create mode 100644 Management/Dockerfile create mode 100644 MetaApi/Dockerfile create mode 100644 Registration/Dockerfile create mode 100644 TikTokApi/Dockerfile diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index e47f21e..f9f27eb 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: CI Test +name: CI Build and Deploy on: push: @@ -6,14 +6,37 @@ on: - master jobs: - test: + build: runs-on: host steps: - name: Checkout code uses: actions/checkout@v3 - - name: Say hello - run: echo "CI runner is working!" - - name: Build - run: dotnet build AdPlatformServers.sln --configuration Release \ No newline at end of file + run: dotnet build AdPlatformServers.sln --configuration Release + + - name: Build Images + run: | + podman build -t adplatform/gateway:latest -f Gateway/Dockerfile . + podman build -t adplatform/management:latest -f Management/Dockerfile . + podman build -t adplatform/creative:latest -f Creative/Dockerfile . + podman build -t adplatform/googleapi:latest -f GoogleApi/Dockerfile . + podman build -t adplatform/intelligenceapi:latest -f IntelligenceApi/Dockerfile . + podman build -t adplatform/metaapi:latest -f MetaApi/Dockerfile . + podman build -t adplatform/tiktokapi:latest -f TikTokApi/Dockerfile . + podman build -t adplatform/registration:latest -f Registration/Dockerfile . + + - name: Transfer Images to App Server + run: | + podman save adplatform/gateway:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/management:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/creative:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/googleapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/intelligenceapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/metaapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/tiktokapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + podman save adplatform/registration:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load" + + - name: Deploy on App Server + run: | + ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "cd /opt/adplatform && podman-compose down && podman-compose up -d" \ No newline at end of file diff --git a/Creative/Dockerfile b/Creative/Dockerfile new file mode 100644 index 0000000..1347dcd --- /dev/null +++ b/Creative/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["Creative/Creative.csproj", "Creative/"] +RUN dotnet restore "Creative/Creative.csproj" +COPY . . +WORKDIR "/src/Creative" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Creative.dll"] \ No newline at end of file diff --git a/Gateway/Dockerfile b/Gateway/Dockerfile new file mode 100644 index 0000000..55e0dce --- /dev/null +++ b/Gateway/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["Gateway/Gateway.csproj", "Gateway/"] +RUN dotnet restore "Gateway/Gateway.csproj" +COPY . . +WORKDIR "/src/Gateway" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Gateway.dll"] \ No newline at end of file diff --git a/GoogleApi/Dockerfile b/GoogleApi/Dockerfile new file mode 100644 index 0000000..b7bf57d --- /dev/null +++ b/GoogleApi/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["GoogleApi/GoogleApi.csproj", "GoogleApi/"] +RUN dotnet restore "GoogleApi/GoogleApi.csproj" +COPY . . +WORKDIR "/src/GoogleApi" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "GoogleApi.dll"] \ No newline at end of file diff --git a/IntelligenceApi/Dockerfile b/IntelligenceApi/Dockerfile new file mode 100644 index 0000000..443b6ba --- /dev/null +++ b/IntelligenceApi/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["IntelligenceApi/IntelligenceApi.csproj", "IntelligenceApi/"] +RUN dotnet restore "IntelligenceApi/IntelligenceApi.csproj" +COPY . . +WORKDIR "/src/IntelligenceApi" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "IntelligenceApi.dll"] \ No newline at end of file diff --git a/Management/Dockerfile b/Management/Dockerfile new file mode 100644 index 0000000..dd4502e --- /dev/null +++ b/Management/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["Management/Management.csproj", "Management/"] +RUN dotnet restore "Management/Management.csproj" +COPY . . +WORKDIR "/src/Management" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Management.dll"] \ No newline at end of file diff --git a/MetaApi/Dockerfile b/MetaApi/Dockerfile new file mode 100644 index 0000000..3d5db2d --- /dev/null +++ b/MetaApi/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["MetaApi/MetaApi.csproj", "MetaApi/"] +RUN dotnet restore "MetaApi/MetaApi.csproj" +COPY . . +WORKDIR "/src/MetaApi" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "MetaApi.dll"] \ No newline at end of file diff --git a/Registration/Dockerfile b/Registration/Dockerfile new file mode 100644 index 0000000..0c68f29 --- /dev/null +++ b/Registration/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["Registration/Registration.csproj", "Registration/"] +RUN dotnet restore "Registration/Registration.csproj" +COPY . . +WORKDIR "/src/Registration" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Registration.dll"] \ No newline at end of file diff --git a/TikTokApi/Dockerfile b/TikTokApi/Dockerfile new file mode 100644 index 0000000..4d60a1f --- /dev/null +++ b/TikTokApi/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY ["TikTokApi/TikTokApi.csproj", "TikTokApi/"] +RUN dotnet restore "TikTokApi/TikTokApi.csproj" +COPY . . +WORKDIR "/src/TikTokApi" +RUN dotnet publish -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "TikTokApi.dll"] \ No newline at end of file