-
Notifications
You must be signed in to change notification settings - Fork 523
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 933 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env
LABEL stage=build-env
WORKDIR /app
# Copy
COPY Directory.Packages.props /app/
COPY ./src/ /app/
ARG GIT_COMMIT
ARG GIT_BRANCH
# Build modules
RUN for module in /app/Modules/*; do \
dotnet build "$module" -c Release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH; \
done
# Build plugins
RUN for plugin in /app/Plugins/*; do \
dotnet build "$plugin" -c Release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH; \
done
# Publish Web project
RUN dotnet publish /app/Web/Grand.Web/Grand.Web.csproj -c Release -o ./build/release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
EXPOSE 8080
WORKDIR /app
COPY --from=build-env /app/build/release .
RUN chown -R app:app /app/App_Data /app/wwwroot /app/Plugins
USER app
ENTRYPOINT ["dotnet", "Grand.Web.dll"]