-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (38 loc) · 1.5 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
ARG DOTNET_VERSION=9.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-alpine AS build
RUN dotnet workload install wasm-tools
WORKDIR /src
# tailwind install
RUN set -ex; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
aarch64) arch='linux-arm64' ;; \
x86_64) arch='linux-x64' ;; \
esac; \
echo Downloading tailwindcss for $apkArch ; \
curl -sL -o tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-$arch; \
chmod +x tailwindcss; \
ls -al tailwindcss ;
RUN apk add python3
# 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
RUN dotnet publish --no-restore -c Release -o /app PointingParty
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION}-alpine
ENV ASPNETCORE_URLS=http://+:8080
ENV ASPNETCORE_ENVIRONMENT=Production
EXPOSE 8080
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT [ "./PointingParty" ]