forked from smartstore/Smartstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (35 loc) · 1.22 KB
/
Dockerfile
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
# -----------------------------------------------------------
# Creates a Docker image by building and publishing
# the source within the container
# -----------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:8.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:8.0
EXPOSE 80
EXPOSE 443
ENV ASPNETCORE_URLS="http://+:80;https://+:443"
WORKDIR /app
COPY --from=build /app/release/publish .
# Install wkhtmltopdf
RUN apt update &&\
apt -y install wget &&\
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb &&\
apt -y install ./wkhtmltox_0.12.6.1-3.bookworm_amd64.deb &&\
rm ./wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
ENTRYPOINT ["./Smartstore.Web", "--urls", "http://0.0.0.0:80"]