python-service-1/Dockerfile

18 lines
443 B
Docker
Raw Normal View History

2021-02-25 10:35:10 +00:00
# set base image (host OS)
FROM python:3.9
WORKDIR /
COPY service/__init__.py /service/
COPY service/requirements.txt /service/
COPY service/simple.py /service/
2021-02-25 10:35:10 +00:00
COPY test/test_simple.py /test/
2021-02-25 10:35:10 +00:00
# install dependencies
RUN pip install -r /service/requirements.txt
2021-02-25 10:35:10 +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
CMD [ "python", "/service/simple.py" ]