-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
Dockerfile
66 lines (50 loc) · 1.74 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# create the build instance
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /src
COPY ./src ./
WORKDIR /src/Presentation/Nop.Web
# build project
RUN dotnet build Nop.Web.csproj -c Release
# build plugins
WORKDIR /src/Plugins
RUN set -eux; \
for dir in *; do \
if [ -d "$dir" ]; then \
dotnet build "$dir/$dir.csproj" -c Release; \
fi; \
done
# publish project
WORKDIR /src/Presentation/Nop.Web
RUN dotnet publish Nop.Web.csproj -c Release -o /app/published
WORKDIR /app/published
RUN mkdir logs bin
RUN chmod 775 App_Data \
App_Data/DataProtectionKeys \
bin \
logs \
Plugins \
wwwroot/bundles \
wwwroot/db_backups \
wwwroot/files/exportimport \
wwwroot/icons \
wwwroot/images \
wwwroot/images/thumbs \
wwwroot/images/uploaded \
wwwroot/sitemaps
# create the runtime instance
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS runtime
# add globalization support
RUN apk add --no-cache icu-libs icu-data-full
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
# installs required packages
RUN apk add tiff --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ --allow-untrusted
RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted
RUN apk add libc-dev tzdata --no-cache
# copy entrypoint script
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
WORKDIR /app
COPY --from=build /app/published .
ENV ASPNETCORE_URLS=http://+:80
EXPOSE 80
ENTRYPOINT "/entrypoint.sh"