-
Notifications
You must be signed in to change notification settings - Fork 5.4k
/
Dockerfile
55 lines (41 loc) · 1.54 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
# create the build instance
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
WORKDIR /src
COPY ./src ./
# build solution
RUN dotnet build NopCommerce.sln --no-incremental -c Release
# 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:9.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"