Skip to content

Commit 3649115

Browse files
committed
fix docker build
1 parent bdb69dc commit 3649115

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Exclude runtime data directories
2+
App_Data/data/
3+
App_Data/backups/
4+
App_Data/__pycache__/
5+
6+
# Exclude build artifacts
7+
**/bin/
8+
**/obj/
9+
**/node_modules/
10+
11+
# Exclude IDE and OS files
12+
.vs/
13+
.vscode/
14+
*.user
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Exclude logs and temporary files
19+
*.log
20+
*.tmp
21+
*.temp

Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ RUN apt-get update && apt-get install -y curl unzip \
1010
&& rm -rf /var/lib/apt/lists/*
1111

1212
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
13+
14+
# Install bun and tailwindcss in build stage
15+
RUN apt-get update && apt-get install -y curl unzip \
16+
&& curl -fsSL https://bun.sh/install | bash \
17+
&& mv /root/.bun/bin/bun /usr/local/bin/ \
18+
&& curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \
19+
&& chmod +x tailwindcss-linux-x64 \
20+
&& mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss \
21+
&& apt-get clean \
22+
&& rm -rf /var/lib/apt/lists/*
23+
1324
WORKDIR /src
1425
COPY ["MyApp/MyApp.csproj", "MyApp/"]
1526
RUN dotnet restore "MyApp/MyApp.csproj"
@@ -18,7 +29,7 @@ WORKDIR "/src/MyApp"
1829
RUN dotnet build "MyApp.csproj" -c Release -o /app/build
1930

2031
FROM build AS publish
21-
RUN dotnet publish "MyApp.csproj" -c Release -o /app/publish /p:UseAppHost=false
32+
RUN dotnet publish "MyApp.csproj" -c Release -o /app/publish /p:UseAppHost=false /p:PublishProfile=""
2233

2334
FROM base AS final
2435
WORKDIR /app

MyApp/MyApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</ItemGroup>
7373

7474
<Target Name="tailwind" BeforeTargets="Publish">
75-
<Exec Command="npm run ui:build" WorkingDirectory="./" />
75+
<Exec Command="bun run ui:build" WorkingDirectory="./" />
7676
</Target>
7777

7878
</Project>

0 commit comments

Comments
 (0)