I discovered two things about the base python:3.5 docker image:
- The Python.h file already exists, it's just in a non-standard place (/usr/local/include/python3.5m). Adding that to the CPATH allows compilation without installing python-dev. It's counterproductive to install python-dev anyway because the python base images install Python from source, not from apt-get, and installing from apt-get kind of ruins that.
- libpq-dev is already installed in the base image.
Therefore, don't need to apt-get install anything! Just make sure that the proper include path is set for C-module compilation.