Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 7f7d0fa

Browse files
ci: Added Dockerfile
1 parent 3595704 commit 7f7d0fa

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

compose.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
services:
2-
### ✅ API Backend (Azure Functions in .NET 9) ###
2+
### ✅ API (Azure Functions in .NET 9) ###
33
api:
44
container_name: "api"
55
build:
6-
context: ./src/api
6+
context: ./src
77
dockerfile: ServiceLayer.API/Dockerfile
88
platform: linux/amd64
99
restart: always
@@ -16,7 +16,6 @@ services:
1616
networks:
1717
- backend
1818

19-
2019
networks:
2120
backend:
2221
driver: bridge

src/ServiceLayer.API/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS installer-env
2+
WORKDIR /src/dotnet-function-app
3+
4+
COPY ./ServiceLayer.API/ServiceLayer.API.csproj .
5+
RUN dotnet restore
6+
7+
COPY ./ServiceLayer.API/ .
8+
9+
RUN dotnet publish -c Release -o /home/site/wwwroot
10+
11+
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated9.0 AS production
12+
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
13+
AzureFunctionsJobHost__Logging__Console__IsEnabled=true \
14+
ASPNETCORE_ENVIRONMENT=Production
15+
16+
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser
17+
USER appuser
18+
19+
COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]

0 commit comments

Comments
 (0)