Skip to content

Instantly share code, notes, and snippets.

@shrikrishnaholla
Created September 25, 2018 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrikrishnaholla/373ddebea01178149460e448a1f09b85 to your computer and use it in GitHub Desktop.
Save shrikrishnaholla/373ddebea01178149460e448a1f09b85 to your computer and use it in GitHub Desktop.
Sample dockerfile for a project that uses spacy
FROM python:3
RUN apt-get update
RUN pip3 install \
spacy \
...
RUN python3 -m spacy download en
COPY . /app
# https://stackoverflow.com/a/39855387/1068511
RUN useradd -ms /bin/bash myapp
USER myapp
WORKDIR /app
# project folder structure
# root
# |---- __init__.py
# |---- scripts
# | |- __init__.py
# | |- training.py
# |
# |---- model
# |- < Generated model >
# build the docker image
# $ docker build -t myspacy .
# run the training script
# $ docker run -v $(pwd)/model:/app/model myspacy python -m scripts.training -o model/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment