-
Notifications
You must be signed in to change notification settings - Fork 0
/
pytest_Dockerfile
54 lines (41 loc) · 1.75 KB
/
pytest_Dockerfile
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
46
47
48
49
50
51
52
53
54
#######################################################################################
#
# Description:
# Build and run testing with Python testing framework *pytest*
#
# Environment variables:
# * TESTING_TYPE: Which testing you want to get and run.
# - Allowable values: 'unit-test', 'integration-test'
#
# Example running docker command line:
# >>> docker build -t sc-cluster_pytest:v0 ./ -f ./Dockerfile_pytest
# >>> docker run --name sc-cluster_pytest -e TESTING_TYPE=unit-test sc-cluster_pytest:v0
#
#######################################################################################
FROM python:3.10
WORKDIR ./apache-smoothcrawler-appintegration/
# # Prepare the runtime environment for Python
RUN pip install -U pip
# # Install the Python dependencies for SmoothCrawler-Cluster package
COPY ./requirements/requirements.txt ./requirements/
RUN pip install -r ./requirements/requirements.txt
# # Install the Python dependencies for development
COPY ./requirements/requirements-test.txt ./requirements/
RUN pip install -U -r ./requirements/requirements-test.txt
# # Prepare for running shell scripts
RUN apt-get update && \
apt-get install -y --no-install-recommends jq
# # Install some internet tool for debug if it needs
#RUN apt-get install -y iputils-ping && \
# apt-get install -y net-tools && \
# apt-get install --no-install-recommends --assume-yes netcat
# # Copy package code, testing code and scripts to container
COPY ./smoothcrawler_appintegration/ ./smoothcrawler_appintegration/
COPY ./test/ ./test/
COPY ./scripts/ ./scripts/
# # Prepare some configurations for running pytest
COPY ./.coveragerc ./
COPY ./pytest.ini ./
CMD bash ./scripts/docker/run-pytest.sh $TESTING_TYPE
# # For debug
#ENTRYPOINT ["tail", "-f", "/dev/null"]