-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (39 loc) · 1.65 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (39 loc) · 1.65 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
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 8080
# Install bun and Typst
RUN apt-get update && apt-get install -y curl unzip ca-certificates xz-utils \
&& curl -fsSL https://bun.sh/install | bash \
&& mv /root/.bun/bin/bun /usr/local/bin/ \
&& curl -fsSL https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz -o /tmp/typst.tar.xz \
&& mkdir -p /tmp/typst \
&& tar -xJf /tmp/typst.tar.xz -C /tmp/typst --strip-components=1 \
&& install /tmp/typst/typst /usr/local/bin/typst \
&& rm -rf /tmp/typst /tmp/typst.tar.xz \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
# Install bun and tailwindcss in build stage
RUN apt-get update && apt-get install -y curl unzip ca-certificates \
&& curl -fsSL https://bun.sh/install | bash \
&& mv /root/.bun/bin/bun /usr/local/bin/ \
&& curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \
&& chmod +x tailwindcss-linux-x64 \
&& mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY ["MyApp/MyApp.csproj", "MyApp/"]
RUN dotnet restore "MyApp/MyApp.csproj"
COPY . .
WORKDIR "/src/MyApp"
RUN dotnet build "MyApp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MyApp.csproj" -c Release -o /app/publish /p:UseAppHost=false /p:PublishProfile=""
# Install npm packages
RUN cd /app/publish && bun install
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
LABEL service="ubixar"
ENTRYPOINT ["dotnet", "MyApp.dll"]