Initial commit - ECommerce project
This commit is contained in:
Executable
+57
@@ -0,0 +1,57 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS base
|
||||
|
||||
# WORKDIR /app
|
||||
# ENV DOTNET_URLS=http://*:2000
|
||||
#ENV ConnectionStrings__PostgreDB="Host=db;Database=ECommerce;Username=said;Password=aaa111!!!AAA;Port=5435;"
|
||||
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
|
||||
FROM base AS build
|
||||
WORKDIR /src
|
||||
|
||||
|
||||
RUN dotnet tool install --global dotnet-ef --version 9.0.*
|
||||
ENV PATH="$PATH:/root/.dotnet/tools"
|
||||
|
||||
|
||||
|
||||
COPY ./Core/ ./Core
|
||||
COPY ./Contracts/ ./Contracts
|
||||
COPY ./Domain/ ./Domain
|
||||
COPY ./ECommerce_API/ ./ECommerce_API
|
||||
|
||||
RUN dotnet ef migrations script --startup-project ECommerce_API --project Domain -o sqlscript.sql
|
||||
|
||||
|
||||
|
||||
|
||||
WORKDIR /src/ECommerce_API
|
||||
RUN dotnet restore
|
||||
RUN dotnet build -c Release -o /build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
|
||||
FROM build AS publish
|
||||
|
||||
WORKDIR /src/ECommerce_API
|
||||
|
||||
|
||||
|
||||
RUN dotnet publish -c Release -o /app/publish
|
||||
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.21-amd64 AS runtime
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=publish /app/publish .
|
||||
COPY --from=build /src/sqlscript.sql .
|
||||
# ENV PATH="$PATH:/root/.dotnet/tools"
|
||||
ENV ASPNETCORE_URLS=http://*:80
|
||||
|
||||
|
||||
|
||||
|
||||
# COPY --from=publish /src/Core.Contracts/EmailTemplates/. ./EmailTemplates
|
||||
ENTRYPOINT ["dotnet", "ECommerce_API.dll"]
|
||||
|
||||
Reference in New Issue
Block a user