Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "C# (.NET)",
"image": "mcr.microsoft.com/devcontainers/dotnet:10.0",
"build": {
"dockerfile": "../Dockerfile",
"context": "..",
"target": "dev"
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
Expand Down
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Git version control
.git
.gitignore
.gitattributes
.github/

# .NET Build outputs and local caches
**/bin/
**/obj/
**/publish/
.vs/
.vscode/

# Environment variables and secrets
.env
*.user
*.suo

# Docker files themselves
Dockerfile
.dockerignore
docker-compose*
.devcontainer/

# OS specific files
.DS_Store
Thumbs.db

CloneDevOpsTemplateTest/
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Development stage, selected by devcontainer.json
FROM mcr.microsoft.com/devcontainers/dotnet:10.0 AS dev
WORKDIR /app

# Production publish stage
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS publish
ARG BUILD_CONFIGURATION=Release
WORKDIR /src

COPY CloneDevOpsTemplate .
RUN dotnet restore CloneDevOpsTemplate.csproj
RUN dotnet publish CloneDevOpsTemplate.csproj \
-c $BUILD_CONFIGURATION \
-o /app/publish \
/p:UseAppHost=false

# Production runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS production
WORKDIR /app
EXPOSE 8080
USER app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CloneDevOpsTemplate.dll"]
Loading