-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.WebStore
More file actions
52 lines (42 loc) · 2.24 KB
/
Dockerfile.WebStore
File metadata and controls
52 lines (42 loc) · 2.24 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
# install Node.js and pnpm
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends nodejs
RUN npm install -g pnpm@10
WORKDIR /source
# copy sln and csproj files and restore
COPY end-point-ecommerce.sln .
COPY EndPointEcommerce.AdminPortal/EndPointEcommerce.AdminPortal.csproj ./EndPointEcommerce.AdminPortal/
COPY EndPointEcommerce.Domain/EndPointEcommerce.Domain.csproj ./EndPointEcommerce.Domain/
COPY EndPointEcommerce.Infrastructure/EndPointEcommerce.Infrastructure.csproj ./EndPointEcommerce.Infrastructure/
COPY EndPointEcommerce.Jobs/EndPointEcommerce.Jobs.csproj ./EndPointEcommerce.Jobs/
COPY EndPointEcommerce.RazorTemplates/EndPointEcommerce.RazorTemplates.csproj ./EndPointEcommerce.RazorTemplates/
COPY EndPointEcommerce.Tests/EndPointEcommerce.Tests.csproj ./EndPointEcommerce.Tests/
COPY EndPointEcommerce.WebApi/EndPointEcommerce.WebApi.csproj ./EndPointEcommerce.WebApi/
COPY EndPointEcommerce.WebStore/EndPointEcommerce.WebStore.csproj ./EndPointEcommerce.WebStore/
RUN dotnet restore
# copy everything else
COPY EndPointEcommerce.AdminPortal/. ./EndPointEcommerce.AdminPortal/
COPY EndPointEcommerce.Domain/. ./EndPointEcommerce.Domain/
COPY EndPointEcommerce.Infrastructure/. ./EndPointEcommerce.Infrastructure/
COPY EndPointEcommerce.Jobs/. ./EndPointEcommerce.Jobs/
COPY EndPointEcommerce.RazorTemplates/. ./EndPointEcommerce.RazorTemplates/
COPY EndPointEcommerce.Tests/. ./EndPointEcommerce.Tests/
COPY EndPointEcommerce.WebApi/. ./EndPointEcommerce.WebApi/
COPY EndPointEcommerce.WebStore/. ./EndPointEcommerce.WebStore/
# build app
WORKDIR /source/EndPointEcommerce.WebStore
RUN pnpm install
RUN pnpm run build
RUN dotnet publish -c release -o /home/app --no-restore
# final stage/image
FROM nginx:1.29-bookworm
COPY deploy-utils/web-store/create-appsettings.sh /
COPY deploy-utils/web-store/entrypoint.sh /
COPY deploy-utils/web-store/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /home/app/wwwroot /usr/share/nginx/html
ENTRYPOINT ["/entrypoint.sh"]
# original CMD that the Nginx image's Dockerfile specifies
CMD ["nginx", "-g", "daemon off;"]