-
Notifications
You must be signed in to change notification settings - Fork 561
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (34 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
42 lines (34 loc) · 1.09 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
# -----------------------------------------------------------
# Creates a Docker image by building and publishing
# the source within the container
# -----------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
# Copy solution and source
ARG SOLUTION=Smartstore.sln
WORKDIR /app
COPY $SOLUTION ./
COPY src/ ./src
COPY test/ ./test
COPY nuget.config ./
# Create Modules dir if missing
RUN mkdir /app/src/Smartstore.Web/Modules -p -v
# Build
RUN dotnet build $SOLUTION -c Release
# Publish
WORKDIR /app/src/Smartstore.Web
RUN dotnet publish Smartstore.Web.csproj -c Release -o /app/release/publish \
--no-self-contained \
--no-restore
# Build Docker image
FROM mcr.microsoft.com/dotnet/aspnet:10.0
EXPOSE 80
EXPOSE 443
ENV ASPNETCORE_URLS="http://+:80;https://+:443"
WORKDIR /app
COPY --from=build /app/release/publish .
# Install wkhtmltopdf
COPY install-wkhtmltopdf.sh /tmp/
RUN chmod +x /tmp/install-wkhtmltopdf.sh && \
/tmp/install-wkhtmltopdf.sh && \
rm /tmp/install-wkhtmltopdf.sh
ENTRYPOINT ["./Smartstore.Web", "--urls", "http://0.0.0.0:80"]