This docker-compose file is mainly based on the guide:
Both parts, the docker-compose.yml
and app/main.py
can be seen as a first starting point to develop a python3 web application.
run
docker build -t bottleserver .
just run
docker-compose up -d web
and now your web-server is running at http://localhost:8080
Default settings are performing python autoload, if the main.py
is changed, for a production setup this should be changed (check app/uwsgi.ini
and comment py-autoreload = 2
line).
For a REST api check the main.py
example, there is a small example provided, e.g.
curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:8080/api
should output:
{"request": {"key1": "value1", "key2": "value2"}}