Skip to content

Instantly share code, notes, and snippets.

@floer32
Last active April 18, 2019 17:41
Show Gist options
  • Save floer32/848ad1b9d01b2f88372da1a4ff43675d to your computer and use it in GitHub Desktop.
Save floer32/848ad1b9d01b2f88372da1a4ff43675d to your computer and use it in GitHub Desktop.
preserve ipython history between docker-compose runs (for local/development usage). diff is only approximately two lines
diff --git a/local.yml b/local.yml
index b587373..73684bf 100644
--- a/local.yml
+++ b/local.yml
@@ -3,6 +3,7 @@ version: '2'
volumes:
#...
+ ipython_data_local: {}
services:
django:
#...
volumes:
+ - ipython_data_local:/root/.ipython/profile_default # persist ipython data, including ipython history
#...
@floer32
Copy link
Author

floer32 commented Apr 18, 2019

It can be done from CLI too without touching compose file, if you prefer. cookiecutter/cookiecutter-django#1794

The paths are a little different in that example, so one or the other may need adjusting. May vary by ipython version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment