I have an environment.yml file which creates the environment:
name: blah
channels:
- conda-forge
dependencies:
- python=3.9
- psychopg2
# THESE ARE FOR LOCAL DEV ONLY
- jupyter
- ipykernel
- folium
There is a huge saving in the docker image size if the local dev packages are excluded from production. But those packages are needed for local testing on development machines etc.
My current solution is to maintain a separate environment_local.yml to run locally which includes these packages, but run environment.yml during the docker build which excludes them. But there is the potential for the files to get out of sync in shared dependencies.
Is there a way to exclude packages from the environment based on a command line flag? Or, can environment files inherit and extend each other?