Skip to content

Commit 533bf9d

Browse files
committed
Added docker file
1 parent 7d6e442 commit 533bf9d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use the official .NET SDK image for building and running tests
2+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
3+
4+
WORKDIR /app
5+
6+
# Copy csproj and restore as distinct layers
7+
COPY *.sln .
8+
COPY playwright-csharp-ui-tests/*.csproj ./playwright-csharp-ui-tests/
9+
RUN dotnet restore
10+
11+
# Copy the rest of the source code
12+
COPY playwright-csharp-ui-tests/. ./playwright-csharp-ui-tests/
13+
14+
WORKDIR /app/playwright-csharp-ui-tests
15+
16+
# Install Playwright browsers
17+
RUN dotnet tool install --global Microsoft.Playwright.CLI \
18+
&& export PATH="$PATH:/root/.dotnet/tools" \
19+
&& playwright install
20+
21+
# Build and run tests
22+
ENTRYPOINT ["dotnet", "test"]

0 commit comments

Comments
 (0)