Exercises
We've covered a lot of material in this chapter. To consolidate what we have learned, we recommend the following two exercises:
- Run
CouchDB
as a Docker container and publish its port, as follows:Tip
You can use the
docker search
command to find theCouchDB
image.- Run the container.
- Publish the
CouchDB
port. - Open the browser and check that
CouchDB
is available.
- Create a Docker image with a REST service, replying
Hello World
tolocalhost:8080/hello
. Use any language and framework you prefer. Here are the steps you need to follow:Tip
The easiest way to create a REST service is to use Python with the Flask framework (https://flask.palletsprojects.com/). Note that a lot of web frameworks, by default, start an application only on the localhost interface. In order to publish a port, it's necessary to start it on all interfaces (
app.run(host='0.0.0.0')
in the case of a Flask framework).- Create a...