Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trstringer/python-flask-docker-compose-debugging
:bug: Sample application to help illustrate how to break into the debugger in a Python Flask application running as a container in Docker Compose
https://github.com/trstringer/python-flask-docker-compose-debugging
compose container debugging docker flask python
Last synced: 4 months ago
JSON representation
:bug: Sample application to help illustrate how to break into the debugger in a Python Flask application running as a container in Docker Compose
- Host: GitHub
- URL: https://github.com/trstringer/python-flask-docker-compose-debugging
- Owner: trstringer
- Created: 2018-01-14T16:01:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T08:15:24.000Z (over 6 years ago)
- Last Synced: 2024-10-04T13:32:26.013Z (4 months ago)
- Topics: compose, container, debugging, docker, flask, python
- Language: Python
- Size: 1.95 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - trstringer/python-flask-docker-compose-debugging - :bug: Sample application to help illustrate how to break into the debugger in a Python Flask application running as a container in Docker Compose (Python)
README
# Debugging a Python Flask app in Docker Compose
This is the companion repository to [this blog post (Medium)](https://medium.com/@trstringer/debugging-a-python-flask-application-in-a-container-with-docker-compose-fa5be981ec9a)
## Running the application
```
$ docker-compose run --build -d
```## Debugging the application
If changes were made to the file (e.g. added breakpoint), build first...
```
$ docker-compose build
```Run the application in Docker Compose but specify a particular command...
```
$ docker-compose run -p 8000:8000 svc1 python3 -m pdb app.py
```Debug the application as you would any other Python application
## Interacting with the application
### Display simple message
```
$ curl localhost:8000
```### Add message to application (Redis cache)
```
$ curl -X POST localhost:8000/message/
```### Get message from application (stored in Redis)
```
$ curl -X POST localhost:8000/message
```