Created
September 25, 2018 14:33
-
-
Save shrikrishnaholla/373ddebea01178149460e448a1f09b85 to your computer and use it in GitHub Desktop.
Sample dockerfile for a project that uses spacy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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