Skip to content

Commit 597d210

Browse files
committed
Playwrightv1.23_Docker_NonRoot
1 parent bece163 commit 597d210

File tree

3 files changed

+160
-151
lines changed

3 files changed

+160
-151
lines changed

Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ RUN npm ci
88

99
COPY . .
1010

11-
RUN npx playwright install chrome
11+
#Adding a non root User named "turing"
12+
RUN useradd -m turing
13+
14+
#Giving Read/Write Access to non-root user to main project folder "/app"
15+
RUN chown -R turing /app
16+
17+
#Switching from root user to non-root user(turing)
18+
USER turing
1219

1320
CMD ["npx","cross-env","ENV=qa","npm","run","test:serial"]

0 commit comments

Comments
 (0)