1 Star 0 Fork 1

Jason艾/EventSourcing.NetCore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
########################################
# First stage of multistage build
########################################
# Use Build image with label `builder
########################################
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS builder
# Setup working directory for project
WORKDIR /app
COPY ./Directory.Build.props ./
COPY ./Core/Core.csproj ./Core/
COPY ./Core.Serialization/Core.Serialization.csproj ./Core.Serialization/
COPY ./Core.Marten/Core.Marten.csproj ./Core.Marten/
COPY ./Core.WebApi/Core.WebApi.csproj ./Core.WebApi/
COPY ./Sample/Tickets/Tickets/Tickets.csproj ./Sample/Tickets/Tickets/
COPY ./Sample/Tickets/Tickets.Api/ ./Sample/Tickets/Tickets.Api/
# Restore nuget packages
RUN dotnet restore ./Sample/Tickets/Tickets.Api/Tickets.Api.csproj
# Copy project files
COPY ./Core ./Core
COPY ./Core.Serialization ./Core.Serialization
COPY ./Core.Marten ./Core.Marten
COPY ./Core.WebApi ./Core.WebApi
COPY ./Sample/Tickets/Tickets ./Sample/Tickets/Tickets
COPY ./Sample/Tickets/Tickets.Api ./Sample/Tickets/Tickets.Api
# Build project with Release configuration
# and no restore, as we did it already
RUN dotnet build -c Release --no-restore ./Sample/Tickets/Tickets.Api/Tickets.Api.csproj
## Test project with Release configuration
## and no build, as we did it already
#RUN dotnet test -c Release --no-build ./Sample/Tickets/Tickets.Api/Tickets.Api.csproj
# Publish project to output folder
# and no build, as we did it already
WORKDIR /app/Sample/Tickets/Tickets.Api
RUN ls
RUN dotnet publish -c Release --no-build -o out
########################################
# Second stage of multistage build
########################################
# Use other build image as the final one
# that won't have source codes
########################################
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine
# Setup working directory for project
WORKDIR /app
# Copy published in previous stage binaries
# from the `builder` image
COPY --from=builder /app/Sample/Tickets/Tickets.Api/out .
# Set URL that App will be exposed
ENV ASPNETCORE_URLS="http://*:5000"
# sets entry point command to automatically
# run application on `docker run`
ENTRYPOINT ["dotnet", "Tickets.Api.dll"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/payiz/EventSourcing.NetCore.git
git@gitee.com:payiz/EventSourcing.NetCore.git
payiz
EventSourcing.NetCore
EventSourcing.NetCore
added_marten_external_commands_handling

搜索帮助