python-service-1/Dockerfile

21 lines
462 B
Docker
Raw Normal View History

2021-02-25 10:35:10 +00:00
# set base image (host OS)
FROM python:3.9
# set the working directory in the container
WORKDIR /code
# copy the dependencies file to the working directory
COPY requirements.txt .
# install dependencies
RUN pip install -r requirements.txt
# copy the content of the local src directory to the working directory
COPY test/ .
COPY src/ .
# Run the tests first
CMD [ "pytest", "-v test_*.py"]
# command to run on container start
CMD [ "python", "./server.py" ]