Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): added postgres container to debug #2151 #2160

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
13 changes: 13 additions & 0 deletions src/.idea/.idea.FluentCMS/.idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions src/FluentCMS/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["FluentCMS/FluentCMS.csproj", "FluentCMS/"]
COPY ["Backend/FluentCMS.Web.Api/FluentCMS.Web.Api.csproj", "Backend/FluentCMS.Web.Api/"]
COPY ["Backend/FluentCMS.Services/FluentCMS.Services.csproj", "Backend/FluentCMS.Services/"]
COPY ["Providers/ApiTokenProviders/FluentCMS.Providers.ApiTokenProviders.Abstractions/FluentCMS.Providers.ApiTokenProviders.Abstractions.csproj", "Providers/ApiTokenProviders/FluentCMS.Providers.ApiTokenProviders.Abstractions/"]
COPY ["Providers/EmailProviders/FluentCMS.Providers.EmailProviders.Abstractions/FluentCMS.Providers.EmailProviders.Abstractions.csproj", "Providers/EmailProviders/FluentCMS.Providers.EmailProviders.Abstractions/"]
COPY ["Providers/FileStorageProviders/FluentCMS.Providers.FileStorageProviders.Abstractions/FluentCMS.Providers.FileStorageProviders.Abstractions.csproj", "Providers/FileStorageProviders/FluentCMS.Providers.FileStorageProviders.Abstractions/"]
COPY ["Providers/MessageBusProviders/FluentCMS.Providers.MessageBusProviders.Abstractions/FluentCMS.Providers.MessageBusProviders.Abstractions.csproj", "Providers/MessageBusProviders/FluentCMS.Providers.MessageBusProviders.Abstractions/"]
COPY ["Backend/FluentCMS.Identity/FluentCMS.Identity.csproj", "Backend/FluentCMS.Identity/"]
COPY ["Backend/Repositories/FluentCMS.Repositories.Abstractions/FluentCMS.Repositories.Abstractions.csproj", "Backend/Repositories/FluentCMS.Repositories.Abstractions/"]
COPY ["Backend/FluentCMS.Entities/FluentCMS.Entities.csproj", "Backend/FluentCMS.Entities/"]
COPY ["Shared/Shared.csproj", "Shared/"]
COPY ["Backend/Repositories/FluentCMS.Repositories.Caching/FluentCMS.Repositories.Caching.csproj", "Backend/Repositories/FluentCMS.Repositories.Caching/"]
COPY ["Providers/CacheProviders/FluentCMS.Providers.CacheProviders.Abstractions/FluentCMS.Providers.CacheProviders.Abstractions.csproj", "Providers/CacheProviders/FluentCMS.Providers.CacheProviders.Abstractions/"]
COPY ["Backend/Repositories/FluentCMS.Repositories.MongoDB/FluentCMS.Repositories.MongoDB.csproj", "Backend/Repositories/FluentCMS.Repositories.MongoDB/"]
COPY ["Backend/Repositories/FluentCMS.Repositories.LiteDb/FluentCMS.Repositories.LiteDb.csproj", "Backend/Repositories/FluentCMS.Repositories.LiteDb/"]
COPY ["Frontend/FluentCMS.Web.UI/FluentCMS.Web.UI.csproj", "Frontend/FluentCMS.Web.UI/"]
COPY ["Providers/TemplateRenderingProviders/FluentCMS.Providers.TemplateRenderingProviders.Abstractions/FluentCMS.Providers.TemplateRenderingProviders.Abstractions.csproj", "Providers/TemplateRenderingProviders/FluentCMS.Providers.TemplateRenderingProviders.Abstractions/"]
COPY ["Frontend/FluentCMS.Web.ApiClients/FluentCMS.Web.ApiClients.csproj", "Frontend/FluentCMS.Web.ApiClients/"]
COPY ["Frontend/FluentCMS.Web.UI.Components/FluentCMS.Web.UI.Components.csproj", "Frontend/FluentCMS.Web.UI.Components/"]
COPY ["Frontend/Plugins/FluentCMS.Web.Plugins.Contents.TextHTML/FluentCMS.Web.Plugins.Contents.TextHTML.csproj", "Frontend/Plugins/FluentCMS.Web.Plugins.Contents.TextHTML/"]
COPY ["Frontend/Plugins/FluentCMS.Web.Plugins.Base/FluentCMS.Web.Plugins.Base.csproj", "Frontend/Plugins/FluentCMS.Web.Plugins.Base/"]
COPY ["Frontend/Plugins/FluentCMS.Web.Plugins.Contents.Block/FluentCMS.Web.Plugins.Contents.Block.csproj", "Frontend/Plugins/FluentCMS.Web.Plugins.Contents.Block/"]
COPY ["Frontend/Plugins/FluentCMS.Web.Plugins.Contents.RichText/FluentCMS.Web.Plugins.Contents.RichText.csproj", "Frontend/Plugins/FluentCMS.Web.Plugins.Contents.RichText/"]
COPY ["Frontend/Plugins/FluentCMS.Web.Plugins.Contents.ContentViewer/FluentCMS.Web.Plugins.Contents.ContentViewer.csproj", "Frontend/Plugins/FluentCMS.Web.Plugins.Contents.ContentViewer/"]
COPY ["Frontend/Plugins/FluentCMS.Web.Plugins.Admin/FluentCMS.Web.Plugins.Admin.csproj", "Frontend/Plugins/FluentCMS.Web.Plugins.Admin/"]
COPY ["Providers/ApiTokenProviders/FluentCMS.Providers.ApiTokenProviders/FluentCMS.Providers.ApiTokenProviders.csproj", "Providers/ApiTokenProviders/FluentCMS.Providers.ApiTokenProviders/"]
COPY ["Providers/CacheProviders/FluentCMS.Providers.CacheProviders/FluentCMS.Providers.CacheProviders.csproj", "Providers/CacheProviders/FluentCMS.Providers.CacheProviders/"]
COPY ["Providers/EmailProviders/FluentCMS.Providers.EmailProviders/FluentCMS.Providers.EmailProviders.csproj", "Providers/EmailProviders/FluentCMS.Providers.EmailProviders/"]
COPY ["Providers/FileStorageProviders/FluentCMS.Providers.FileStorageProviders/FluentCMS.Providers.FileStorageProviders.csproj", "Providers/FileStorageProviders/FluentCMS.Providers.FileStorageProviders/"]
COPY ["Providers/MessageBusProviders/FluentCMS.Providers.MessageBusProviders/FluentCMS.Providers.MessageBusProviders.csproj", "Providers/MessageBusProviders/FluentCMS.Providers.MessageBusProviders/"]
COPY ["Providers/TemplateRenderingProviders/FluentCMS.Providers.TemplateRenderingProviders/FluentCMS.Providers.TemplateRenderingProviders.csproj", "Providers/TemplateRenderingProviders/FluentCMS.Providers.TemplateRenderingProviders/"]
COPY ["Backend/Repositories/FluentCMS.Repositories.Postgres/FluentCMS.Repositories.Postgres.csproj", "Backend/Repositories/FluentCMS.Repositories.Postgres/"]
RUN dotnet restore "FluentCMS/FluentCMS.csproj"
COPY . .
WORKDIR "/src/FluentCMS"
RUN dotnet build "FluentCMS.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "FluentCMS.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FluentCMS.dll"]
17 changes: 17 additions & 0 deletions src/dev.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.8'

services:
fluentcms-db:
image: postgres:latest
container_name: fluentcms-db
environment:
POSTGRES_USER: fluentcms_user
POSTGRES_PASSWORD: fluentcms_password
POSTGRES_DB: fluentcms_db
volumes:
- fluentcms_db_data:/var/lib/postgresql/data
ports:
- "5432:5432"

volumes:
fluentcms_db_data: