-
Notifications
You must be signed in to change notification settings - Fork 272
/
Dockerfile
59 lines (44 loc) · 2.15 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
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
ARG BUILD_VERSION=1.0.0.0
WORKDIR /work
COPY ["src/Papercut.Service/Papercut.Service.csproj", "/work/Papercut.Service/"]
COPY ["src/Papercut.Common/Papercut.Common.csproj", "/work/Papercut.Common/"]
COPY ["src/Papercut.Core/Papercut.Core.csproj", "/work/Papercut.Core/"]
COPY ["src/Papercut.Infrastructure.IPComm/Papercut.Infrastructure.IPComm.csproj", "/work/Papercut.Infrastructure.IPComm/"]
COPY ["src/Papercut.Infrastructure.Smtp/Papercut.Infrastructure.Smtp.csproj", "/work/Papercut.Infrastructure.Smtp/"]
COPY ["src/Papercut.Message/Papercut.Message.csproj", "/work/Papercut.Message/"]
COPY ["src/Papercut.Rules/Papercut.Rules.csproj", "/work/Papercut.Rules/"]
RUN dotnet restore "/work/Papercut.Service/Papercut.Service.csproj"
COPY . .
#RUN sed "s/\(Assembly\(Informational\|File\)Version(\d34[0-9]\+\.[0-9]\+\.[0-9]\+\.\)[0-9]\+/\1$BUILD_VERSION/" src/GlobalAssemblyInfo.cs
WORKDIR "/work/src/Papercut.Service"
RUN dotnet build "Papercut.Service.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Papercut.Service.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
ARG BUILD_VERSION
ARG BUILD_DATE
ARG VCS_REF
LABEL org.opencontainers.image.title="Papercut SMTP Service" \
org.opencontainers.image.description="Papercut SMTP Service is a 2-in-1 quick email viewer AND built-in SMTP server" \
org.opencontainers.image.version=${BUILD_VERSION} \
org.opencontainers.image.url="https://www.papercut-smtp.com/" \
org.opencontainers.image.source="https://github.com/ChangemakerStudios/Papercut-SMTP" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.licenses="Apache License, Version 2.0"
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_HTTP_PORTS=80
# HTTP
EXPOSE 80
# SMTP
EXPOSE 25
# optional -- should only be used locally: IPComm
# EXPOSE 37403
CMD ["dotnet", "Papercut.Service.dll"]