File tree Expand file tree Collapse file tree 1 file changed +25
-6
lines changed
Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Original file line number Diff line number Diff line change 1+ # This dockerfile allows for the code from the project to be built into a Docker image,
2+ # for use in a CI/CD-style environment such as GitHub Actions or Jenkins.
3+ # Further reading on this: https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-an-image/
4+
15FROM python:3.13-slim
26
7+ # Create non-root OS user/group and configure environment
8+ RUN addgroup --system nonroot \
9+ && adduser --system --home /home/nonroot nonroot --ingroup nonroot
10+
311WORKDIR /test
412
13+ ENV HOME=/home/nonroot
14+ ENV PATH="$HOME/.local/bin:$PATH"
15+
516# Install dependencies
617COPY ./requirements.txt ./requirements.txt
7- RUN pip install --no-cache-dir -r requirements.txt
8- RUN playwright install --with-deps
9- RUN playwright install chrome
18+ RUN pip install --no-cache-dir -r requirements.txt && \
19+ playwright install --with-deps && \
20+ mkdir -p /tests/ && \
21+ mkdir -p /utils/ && \
22+ mkdir -p /pages/
1023
11- RUN mkdir -p /tests/
24+ # Copy project files
1225COPY ./tests/ ./tests/
13- RUN mkdir -p /utils/
1426COPY ./utils/ ./utils/
27+ COPY ./pages/ ./pages/
28+ COPY ./conftest.py ./conftest.py
1529COPY ./pytest.ini ./pytest.ini
1630COPY ./run_tests.sh ./run_tests.sh
31+ COPY ./users.json ./users.json
32+
33+ # Set permissions, make the script executable and switch OS user
34+ RUN chmod +x ./run_tests.sh \
35+ && chown -R nonroot:nonroot /test
1736
18- RUN chmod +x ./run_tests.sh
37+ USER nonroot
You can’t perform that action at this time.
0 commit comments