PoliticalFraming / politicalframing

http://www.politicalframing.com
9 stars 1 forks source link

Create script to download wordnet automatically on dokku/docker #43

Open AlJohri opened 10 years ago

AlJohri commented 10 years ago

http://gavinmhackeling.com/blog/2012/03/deploying-a-python-app-with-flask-and-nltk-to-heroku/

AlJohri commented 10 years ago

Either put it in __init__.py or just commit it to the repo.

AlJohri commented 10 years ago
python -m nltk.downloader wordnet -d ./nltk_data
nltk.data.path.append('./nltk_data/')

source: http://stackoverflow.com/a/14869451

dmil commented 10 years ago

The default system location on Windows is C:\nltk_data; and on Mac and Unix is /usr/share/nltk_data. You can use the -d flag to specify a different location (but if you do this, be sure to set the NLTK_DATA environment variable accordingly).

http://www.nltk.org/data.html -- look @ command line installation

AlJohri commented 10 years ago

So if I go in and manually do

id=$(sudo docker run -d app/dev /exec python -m nltk.downloader wordnet)
sudo docker commit $id app/dev
dokku deploy dev

^^ its something like this...

I actually did dokku run dev python -m nltk.downloader wordnet and then found the container id to commit within sudo docker ps -a

it will work as a stop gap solution -- but you need to do it every time ...