-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (32 loc) · 1.48 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
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
WORKDIR /app
ENV ASPNETCORE_URLS=http://+:80
ENV FileStorageOptions__Path=/app/files
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
RUN curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh
RUN chmod 500 nsolid_setup_deb.sh
RUN ./nsolid_setup_deb.sh 21
RUN apt-get install nodejs -y
COPY ["SecureSend/SecureSend.csproj", "SecureSend/"]
COPY ["SecureSend.Application/SecureSend.Application.csproj", "SecureSend.Application/"]
COPY ["SecureSend.Infrastructure/SecureSend.Infrastructure.csproj", "SecureSend.Infrastructure/"]
COPY ["SecureSend.Domain/SecureSend.Domain.csproj", "SecureSend.Domain/"]
COPY ["SecureSend.SqlServerMigrations/SecureSend.SqlServerMigrations.csproj", "SecureSend.SqlServerMigrations/"]
COPY ["SecureSend.PostgresMigrations/SecureSend.PostgresMigrations.csproj", "SecureSend.PostgresMigrations/"]
RUN dotnet restore "SecureSend/SecureSend.csproj"
COPY . .
WORKDIR "/src/SecureSend"
RUN dotnet build "SecureSend.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "SecureSend.csproj" --no-restore -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
EXPOSE 80
RUN mkdir -p /app/files
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "SecureSend.dll"]