January 2018
Intermediate to advanced
366 pages
9h 7m
English
Our application is being developed on all containers and this case is no different. Let us declare our microservice Dockerfile. In this case, we will use a Python container, since it is the programming language used in microservices.
In this file, there are two points of attention. The first is the file requirements.txt, which contains all the dependencies of the project. The second point of attention is the exhibition of port 5000, because the application server runs there:
FROM python:3.6.1 COPY . /app WORKDIR /app RUN pip install -r requirements.txt ENTRYPOINT ["python"] CMD ["app.py"] EXPOSE 5000
Read now
Unlock full access