2021-02-25 10:35:10 +00:00
|
|
|
# set base image (host OS)
|
|
|
|
FROM python:3.9
|
|
|
|
|
2021-02-25 13:41:02 +00:00
|
|
|
WORKDIR /
|
|
|
|
COPY service/__init__.py /service/
|
|
|
|
COPY service/requirements.txt /service/
|
|
|
|
COPY service/simple.py /service/
|
2021-02-25 10:35:10 +00:00
|
|
|
|
2021-02-25 13:41:02 +00:00
|
|
|
COPY test/test_simple.py /test/
|
2021-02-25 10:35:10 +00:00
|
|
|
|
|
|
|
# install dependencies
|
2021-02-25 13:41:02 +00:00
|
|
|
RUN pip install -r /service/requirements.txt
|
2021-02-25 10:35:10 +00:00
|
|
|
|
2021-02-25 13:41:02 +00:00
|
|
|
# Run the tests as the final check
|
|
|
|
RUN export PYTHONPATH=$PYTHONPATH:./;pytest -v /test/test_*.py -r A
|
2021-02-25 10:35:10 +00:00
|
|
|
|
|
|
|
# command to run on container start
|
2021-02-25 13:41:02 +00:00
|
|
|
CMD [ "python", "/service/simple.py" ]
|