Given multiple flask services running in multiple docker containers. A typical docker-compose looks like this
version: '3'
services:
service1:
environment:
FLASK_DEBUG: 1
volumes:
- .:/code
image: flask-service1
build:
context: .
dockerfile: 'service1/Dockerfile'
ports:
- "5001:5001"
service2:
environment:
FLASK_DEBUG: 1
volumes:
- .:/code
image: flask-service2
build:
context: .
dockerfile: 'service2/Dockerfile'
ports:
- "5002:5002"
Services are started from PyCharm entry point which runs docker-compose up. Now, both services are up and running, I need to enable stopping at breakpoints.
Each service is a flask app running on a different port:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello world!'
if __name__ == '__main__':
app.run()