adrug
adrug

Reputation: 111

Optimal environment setup for Python development with Docker

I need to develop a bunch of Python scripts pulling data from various sources asynchronously and populating a shared database. Everything will eventually run off AWS, while I do my developing locally on a Win10 machine.

To avoid any compatibility issues, I would like to get going with Docker for this project - but I'm not sure how to set up my environment for development. One option I can see might work is using PyCharm and their Docker plugin.

What are the other options? I would like to be able to execute snippets of code directly from the editor in an interactive mode, on the back of a Docker image that I would then be able to deploy on AWS in large numbers.

Upvotes: 0

Views: 144

Answers (1)

Ryan
Ryan

Reputation: 5046

Docker development can be very productive using either of these two options:

  1. You can map source code volumes into a production image.
    This works in the same way as a normal VM-based development cycle. Be careful with the number/size of your mounts if you aren't developing on Linux.
  2. Optimise your Dockerfile for rebuild efficiency.
    Docker builds can be super fast if you do them carefully. This path is better (or necessary) if you are using swarm because it tends to depend on built images with proper digests.

I have not found the PHPStorm Docker extension very helpful, and I suspect PyCharm would be similar. It is really just a wrapper to basic docker container build|run|ps.

I'm not sure executing code snippets will be that easy, but there might be a way to pipe it into a running container.

Upvotes: 1

Related Questions