-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (43 loc) · 1.81 KB
/
Dockerfile
File metadata and controls
50 lines (43 loc) · 1.81 KB
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
ARG DOTNET_VERSION=10.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build
ARG SYNCFUSION_LICENSE_KEY
RUN apt-get update && apt-get install -y python3 curl && rm -rf /var/lib/apt/lists/*
RUN dotnet workload install wasm-tools
WORKDIR /src
# tailwind install
RUN set -ex; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
arm64) arch='linux-arm64' ;; \
amd64) arch='linux-x64' ;; \
esac; \
echo Downloading tailwindcss for $arch ; \
curl -sL -o tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/tailwindcss-$arch; \
chmod +x tailwindcss; \
ls -al tailwindcss ;
# restore
COPY *.sln .
COPY PointingParty/PointingParty.csproj PointingParty/PointingParty.csproj
COPY PointingParty.Client/PointingParty.Client.csproj PointingParty.Client/PointingParty.Client.csproj
COPY PointingParty.Client.Tests/PointingParty.Client.Tests.csproj PointingParty.Client.Tests/PointingParty.Client.Tests.csproj
COPY PointingParty.Domain/PointingParty.Domain.csproj PointingParty.Domain/PointingParty.Domain.csproj
RUN dotnet restore
# copy everything
COPY . ./
# tailwind build
RUN set -ex; \
./tailwindcss -i PointingParty/wwwroot/app.css -o PointingParty/wwwroot/app.min.css --minify && rm PointingParty/wwwroot/app.css
# build - pass SyncfusionLicenseKey MSBuild property to embed metadata in both projects
RUN dotnet publish -c Release -o /app PointingParty \
/p:SyncfusionLicenseKey="$SYNCFUSION_LICENSE_KEY"
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION}
ARG SYNCFUSION_LICENSE_KEY
ENV ASPNETCORE_URLS=http://+:8080
ENV ASPNETCORE_ENVIRONMENT=Production
# Optional runtime fallback for server
ENV SYNCFUSION_LICENSE_KEY=${SYNCFUSION_LICENSE_KEY}
EXPOSE 8080
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT [ "./PointingParty" ]