Wing Tips: Debug Python Code Run by Docker Compose with Wing Pro

Sep 21, 2021


This Wing Tip describes how to configure Docker Compose so that Python code running on selected container services can be debugged with Wing Pro. This makes it easy to develop and debug containerized applications written in Python.

Getting Started

Before you can work with Docker Compose you will need to download and install it and then create a working test cluster. See Install Docker Compose for details.

You should also install Wing Pro if you don't already have it.

Configuration

To configure Wing to use New Project in the Project menu. After selecting your source directory, choose Use Existing Python on the second dialog page, and then select Cluster:

/images/blog/docker-compose/python-executable.png

Next create a new cluster configuration by pressing the New button. This displays the cluster configuration dialog. You will need to enter an identifier to use within Wing and point it at the docker-compose.yml file for the cluster. You will also need to select the main service to use as the default place to run your Python Shell and unit test processes:

/images/blog/docker-compose/cluster-config.png

Once you have created your cluster configuration, submit the New Project dialog to complete your project setup.

Working with the Cluster

You can now control your cluster from Wing's Containers tool, found in the Tools menu. This tool lists the services in your cluster and their status. You can right-click on items here or use the Options menu to build, start, debug, and stop your cluster:

/images/blog/docker-compose/containers-tool.png

Debug processes, unit tests, Wing's integrated Python Shell and OS Commands can all be run in context of the cluster, or optionally instead within isolated containers that match the cluster configuration but run without launching the whole cluster.

See Using Wing Pro with Docker Compose for more information working with clusters in Wing Pro.



That's it for now! We'll be back soon with more Wing Tips for Wing Python IDE.

As always, please don't hesitate to email support@wingware.com if you run into problems, have any questions, or have topic suggestions for future Wing Tips!



Share this article: